sectionsd: unify and optimize debug messages

Origin commit data
------------------
Commit: f5346d9f91
Author: limes007 <39467727+limes007@users.noreply.github.com>
Date: 2019-02-23 (Sat, 23 Feb 2019)
This commit is contained in:
limes007
2019-02-23 22:40:56 +01:00
committed by vanhofen
parent 68acd069da
commit c8aa325509
9 changed files with 270 additions and 245 deletions

View File

@@ -26,14 +26,14 @@
#include <sys/time.h>
#include "debug.h"
bool sections_debug;
int sections_debug = DEBUG_NORMAL;
void printdate_ms(FILE *f) {
timeval now;
gettimeofday(&now, NULL);
struct tm *tm = localtime(&now.tv_sec);
/* use strftime for that? */
fprintf(f, "%02d:%02d:%02d.%03ld ", tm->tm_hour, tm->tm_min, tm->tm_sec, now.tv_usec/1000);
fprintf(f, "%04d-%02d-%02d %02d:%02d:%02d.%03ld ", tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, now.tv_usec/1000);
}
static int64_t last_profile_call;