Example #1
0
File: log.c Project: sisoftrg/qico
void write_log(char *fmt,...)
{
	va_list args;
	va_start(args,fmt);
	vwrite_log(fmt,NULL,1,args);
	va_end(args);
}
Example #2
0
/**
 * 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;
}
Example #3
0
File: log.c Project: sisoftrg/qico
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);
}
Example #4
0
File: log.c Project: ftnapps/qico
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 );
}
Example #5
0
File: log.c Project: ftnapps/qico
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 );
}
Example #6
0
void log(const char *fmt, ...) {
  va_list ap;
  va_start(ap, fmt);
  vwrite_log(fmt, ap);
  va_end(ap);
}