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 @@
#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
......
......@@ -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
......
......@@ -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
}
......
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