🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c
Article #9409

debugging/logging macros

#9409
From: Matt Crawford
Date: Sun, 28 Sep 1986 04:13
20 lines
1018 bytes
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
Technical Details
Message-ID: <1498@oddjob.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbatt!ihnp4!gargoyle!sphinx!oddjob!matt

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!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