/* ***************************************************************************** * * Copyright 1992, Xylogics, Inc. ALL RIGHTS RESERVED. * * ALL RIGHTS RESERVED. Licensed Material - Property of Xylogics, Inc. * This software is made available solely pursuant to the terms of a * software license agreement which governs its use. * Unauthorized duplication, distribution or sale are strictly prohibited. * * Module Description:: * * Debugging support routines for systems without vsprintf. * * Original Author: James Carlson Created on: 05AUG92 * * Module Reviewers: * lint * * Revision Control Information: * $Id: debugging.novf,v 1.3 1992/09/03 10:39:09 carlson Rel $ * * This file created by RCS from * $Source: /annex/common/src/./newrtelnet/RCS/debugging.novf,v $ * * Revision History: * $Log: debugging.novf,v $ * Revision 1.3 1992/09/03 10:39:09 carlson * Added config.h for SCO Unix -- alignment problems with fprintf. * * Revision 1.2 92/08/05 15:56:58 carlson * Added missing module header. * * This file is currently under revision by: $Locker: $ * ***************************************************************************** */ /* * Include Files */ #include "../inc/config.h" #include #include #include #include "rtelnet.h" #ifndef NO_DEBUG /* * External Definitions */ extern int debug,process_id; /* * Global Data Declarations */ char dbgrev[] = "$Revision: 1.3 $"; char dbgsrc[] = "$Source: /annex/common/src/./newrtelnet/RCS/debugging.novf,v $"; /* * Static Data Declarations */ static char *severity[] = { "INIT", /* Entry/Exit messages */ "INFO", /* Informational messages */ "WARN", /* Warnings */ "ERR ", /* Errors */ "FATL" /* Fatal internal problems */ }; static char dbuf[1024]; void initialize_debugging() { } /*VARARGS 3*/ void _DBG(level,sever,fmt,a,b,c,d,e,f,g) int level,sever; char *fmt,*a,*b,*c,*d,*e,*f,*g; { time_t thetime; register struct tm *tm; if (debug >= level) { thetime = time(NULL); tm = localtime(&thetime); (void)sprintf(dbuf,"%s:%d:%d%02d%02d%02d%02d%02d: ", severity[sever],process_id,tm->tm_year+1900, tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min, tm->tm_sec); (void)sprintf(dbuf+strlen(dbuf),fmt,a,b,c,d,e,f,g); (void)fprintf(stderr,"%s\n",dbuf); } } #endif /* NO_DEBUG */