CS_LOG_TS_DIFF -> CS_LOG_ENABLE_TS_DIFF; ifdef->if

PUBLISHED_FROM=48c8d4326ea8a24edd8d1ca011be9e7643219084
This commit is contained in:
Deomid Ryabkov 2016-11-10 16:16:23 +00:00 committed by Cesanta Bot
parent e1a9ad7f82
commit fd45a6d31b
3 changed files with 9 additions and 9 deletions

View File

@ -14,8 +14,8 @@
#define CS_ENABLE_DEBUG 0
#endif
#ifndef CS_LOG_TS_DIFF
#define CS_LOG_TS_DIFF 0
#ifndef CS_LOG_ENABLE_TS_DIFF
#define CS_LOG_ENABLE_TS_DIFF 0
#endif
#ifdef __cplusplus

View File

@ -14,8 +14,8 @@
#define CS_ENABLE_DEBUG 0
#endif
#ifndef CS_LOG_TS_DIFF
#define CS_LOG_TS_DIFF 0
#ifndef CS_LOG_ENABLE_TS_DIFF
#define CS_LOG_ENABLE_TS_DIFF 0
#endif
#ifdef __cplusplus

View File

@ -187,8 +187,8 @@ MG_INTERNAL void mg_close_conn(struct mg_connection *conn);
#define CS_ENABLE_DEBUG 0
#endif
#ifndef CS_LOG_TS_DIFF
#define CS_LOG_TS_DIFF 0
#ifndef CS_LOG_ENABLE_TS_DIFF
#define CS_LOG_ENABLE_TS_DIFF 0
#endif
#ifdef __cplusplus
@ -279,14 +279,14 @@ enum cs_log_level cs_log_level =
FILE *cs_log_file = NULL;
#ifdef CS_LOG_TS_DIFF
#if CS_LOG_ENABLE_TS_DIFF
double cs_log_ts;
#endif
void cs_log_print_prefix(const char *func) {
if (cs_log_file == NULL) cs_log_file = stderr;
fprintf(cs_log_file, "%-20s ", func);
#ifdef CS_LOG_TS_DIFF
#if CS_LOG_ENABLE_TS_DIFF
{
double now = cs_time();
fprintf(cs_log_file, "%7u ", (unsigned int) ((now - cs_log_ts) * 1000000));
@ -312,7 +312,7 @@ void cs_log_set_file(FILE *file) {
void cs_log_set_level(enum cs_log_level level) {
cs_log_level = level;
#if CS_LOG_TS_DIFF && CS_ENABLE_STDIO
#if CS_LOG_ENABLE_TS_DIFF && CS_ENABLE_STDIO
cs_log_ts = cs_time();
#endif
}