void write_log(char *fmt,...) { va_list args; va_start(args,fmt); vwrite_log(fmt,NULL,1,args); va_end(args); }
/** * NAME: write_log * PURPOSE: write log message * ARGS: facility - logging facility * level - severity level * format - user provided message * ... - extra format specific arguments * RETURN: number of bytes written to the log file */ int write_log(int facility, int level, char const *format, ...) { va_list args; int r; va_start(args, format); r = vwrite_log(facility, level, format, args); va_end(args); return r; }
void write_debug_log(unsigned char facility,int level,char *fmt,...) { va_list args; char prefix[16]; #ifndef __GNUC__ if (facilities_levels[facility]<level)return; #endif snprintf(prefix,16,"DBG_%c%02d: ",facility,level); va_start(args, fmt); vwrite_log(fmt,prefix,facilities_levels['X']>=level,args); va_end(args); }
void write_log(const char *fmt, ...) { static char str[LARGE_STRING + 5]; va_list args; str[0] = '\0'; va_start( args, fmt ); vsnprintf( str, LARGE_STRING, fmt, args ); va_end( args ); vwrite_log( str, 1 ); }
void write_debug_log(unsigned char facility, int level, const char *fmt, ...) { static char str[1024]; va_list args; str[0] = '\0'; #ifndef __GNUC__ if ( facilities_levels[facility] < level ) return; #endif snprintf( str, 16, "DBG_%c%02d: ", facility, level ); /* make string in buffer */ va_start(args, (const char *) fmt); vsnprintf( str + strlen( str ), sizeof( str ) - strlen( str ), fmt, args ); va_end( args ); vwrite_log( str, facilities_levels['G'] >= level ); }
void log(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vwrite_log(fmt, ap); va_end(ap); }