Commit fd45a6d3 authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by Cesanta Bot

CS_LOG_TS_DIFF -> CS_LOG_ENABLE_TS_DIFF; ifdef->if

PUBLISHED_FROM=48c8d4326ea8a24edd8d1ca011be9e7643219084
parent e1a9ad7f
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#define CS_ENABLE_DEBUG 0 #define CS_ENABLE_DEBUG 0
#endif #endif
#ifndef CS_LOG_TS_DIFF #ifndef CS_LOG_ENABLE_TS_DIFF
#define CS_LOG_TS_DIFF 0 #define CS_LOG_ENABLE_TS_DIFF 0
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#define CS_ENABLE_DEBUG 0 #define CS_ENABLE_DEBUG 0
#endif #endif
#ifndef CS_LOG_TS_DIFF #ifndef CS_LOG_ENABLE_TS_DIFF
#define CS_LOG_TS_DIFF 0 #define CS_LOG_ENABLE_TS_DIFF 0
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -187,8 +187,8 @@ MG_INTERNAL void mg_close_conn(struct mg_connection *conn); ...@@ -187,8 +187,8 @@ MG_INTERNAL void mg_close_conn(struct mg_connection *conn);
#define CS_ENABLE_DEBUG 0 #define CS_ENABLE_DEBUG 0
#endif #endif
#ifndef CS_LOG_TS_DIFF #ifndef CS_LOG_ENABLE_TS_DIFF
#define CS_LOG_TS_DIFF 0 #define CS_LOG_ENABLE_TS_DIFF 0
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
...@@ -279,14 +279,14 @@ enum cs_log_level cs_log_level = ...@@ -279,14 +279,14 @@ enum cs_log_level cs_log_level =
FILE *cs_log_file = NULL; FILE *cs_log_file = NULL;
#ifdef CS_LOG_TS_DIFF #if CS_LOG_ENABLE_TS_DIFF
double cs_log_ts; double cs_log_ts;
#endif #endif
void cs_log_print_prefix(const char *func) { void cs_log_print_prefix(const char *func) {
if (cs_log_file == NULL) cs_log_file = stderr; if (cs_log_file == NULL) cs_log_file = stderr;
fprintf(cs_log_file, "%-20s ", func); fprintf(cs_log_file, "%-20s ", func);
#ifdef CS_LOG_TS_DIFF #if CS_LOG_ENABLE_TS_DIFF
{ {
double now = cs_time(); double now = cs_time();
fprintf(cs_log_file, "%7u ", (unsigned int) ((now - cs_log_ts) * 1000000)); fprintf(cs_log_file, "%7u ", (unsigned int) ((now - cs_log_ts) * 1000000));
...@@ -312,7 +312,7 @@ void cs_log_set_file(FILE *file) { ...@@ -312,7 +312,7 @@ void cs_log_set_file(FILE *file) {
void cs_log_set_level(enum cs_log_level level) { void cs_log_set_level(enum cs_log_level level) {
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(); cs_log_ts = cs_time();
#endif #endif
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment