fixed logging errorx
This commit is contained in:
parent
79bb9552da
commit
3cbcda0886
|
@ -7,7 +7,7 @@
|
||||||
/* string equivalents to the severity values */
|
/* string equivalents to the severity values */
|
||||||
static const char *severities[] = { "FATAL", "ERROR", "WARN ", "INFO ", "DEBUG" };
|
static const char *severities[] = { "FATAL", "ERROR", "WARN ", "INFO ", "DEBUG" };
|
||||||
|
|
||||||
static FILE *logfile = stdout; /* log file pointer */
|
static FILE *logfile = NULL; /* log file pointer */
|
||||||
|
|
||||||
void Log(int level, const char *format, ...)
|
void Log(int level, const char *format, ...)
|
||||||
{
|
{
|
||||||
|
@ -24,7 +24,7 @@ void Log(int level, const char *format, ...)
|
||||||
gettimeofday(&tv, NULL);
|
gettimeofday(&tv, NULL);
|
||||||
localtime_r(&(tv.tv_sec), &tm);
|
localtime_r(&(tv.tv_sec), &tm);
|
||||||
strftime(timestamp, 32, "%F %T", &tm);
|
strftime(timestamp, 32, "%F %T", &tm);
|
||||||
fprintf(logfile, "%s.%06u %s %s\n", timestamp, tv.tv_usec, severities[level], buf);
|
fprintf(logfile ? logfile : stdout, "%s.%06u %s %s\n", timestamp, tv.tv_usec, severities[level], buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Log_assert_failed(const char *test, const char *file, int line)
|
void Log_assert_failed(const char *test, const char *file, int line)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user