Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbatt!ihnp4!gargoyle!sphinx!oddjob!matt From: matt@oddjob.UUCP (Matt Crawford) Newsgroups: net.lang.c Subject: debugging/logging macros Message-ID: <1498@oddjob.UUCP> Date: Sun, 28-Sep-86 00:13:02 EDT Article-I.D.: oddjob.1498 Posted: Sun Sep 28 00:13:02 1986 Date-Received: Tue, 30-Sep-86 06:25:41 EDT Organization: U. Chicago, Astronomy & Astrophysics Lines: 20 The way net.sources is going, I should write a 4KB man page for this and shar it up and post it there! I like the following logging/debugging macro #ifndef LOGLEVEL #define LOGLEVEL 0 #endif #define LOG(n) if ( (n) > LOGLEVEL ) ; else fprintf use it like this: LOG(1)(stderr, "LISM model server starting at %s\n", tstamp()); You could instead make LOGLEVEL a variable and catch a signal to toggle it. _____________________________________________________ Matt University crawford@anl-mcs.arpa Crawford of Chicago ihnp4!oddjob!matt