|
|
@ -105,13 +105,10 @@ void applog(int prio, const char *fmt, ...) |
|
|
|
const char* color = ""; |
|
|
|
const char* color = ""; |
|
|
|
char *f; |
|
|
|
char *f; |
|
|
|
int len; |
|
|
|
int len; |
|
|
|
struct tm tm, *tm_p; |
|
|
|
struct tm tm; |
|
|
|
time_t now = time(NULL); |
|
|
|
time_t now = time(NULL); |
|
|
|
|
|
|
|
|
|
|
|
pthread_mutex_lock(&applog_lock); |
|
|
|
localtime_r(&now, &tm); |
|
|
|
tm_p = localtime(&now); |
|
|
|
|
|
|
|
memcpy(&tm, tm_p, sizeof(tm)); |
|
|
|
|
|
|
|
pthread_mutex_unlock(&applog_lock); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (prio) { |
|
|
|
switch (prio) { |
|
|
|
case LOG_ERR: color = CL_RED; break; |
|
|
|
case LOG_ERR: color = CL_RED; break; |
|
|
|