add session id generator
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "toml.h"
|
||||
@@ -276,6 +277,8 @@ void log_print(enum log_level level, const char *module, const char *fmt, ...)
|
||||
// add time
|
||||
p += snprintf(p, end - p, "%s %s %d %02d:%02d:%02d %d ",
|
||||
weekday_str[local.tm_wday], month_str[local.tm_mon], local.tm_mday, local.tm_hour, local.tm_min, local.tm_sec, local.tm_year + 1900);
|
||||
// add tid
|
||||
p += snprintf(p, end - p, "%lu ", pthread_self());
|
||||
// add level
|
||||
p += snprintf(p, end - p, "%s ", level_str[level]);
|
||||
// add module
|
||||
|
||||
Reference in New Issue
Block a user