mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-23 20:11:49 +00:00
CS_LOG_TS_DIFF -> CS_LOG_ENABLE_TS_DIFF; ifdef->if
PUBLISHED_FROM=48c8d4326ea8a24edd8d1ca011be9e7643219084
This commit is contained in:
1 parent
e1a9ad7f82
commit
fd45a6d31b
3 files changed
+9
-9
No files matched your search
@@ -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 @@
|
|||||||
#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
|
||||||
|
|||||||
+5
-5
@@ -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 =
|
|||||||
|
|
||||||
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) {
|
|||||||
|
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user