Module: kamailio
Branch: master
Commit: f6f68cb91a1a1143d5cd64f7a847002cd897eb8b
URL:
https://github.com/kamailio/kamailio/commit/f6f68cb91a1a1143d5cd64f7a847002…
Author: Armen Babikyan <armen(a)firespotter.com>
Committer: Armen Babikyan <armen(a)firespotter.com>
Date: 2018-08-01T14:01:53-07:00
core: print log_prefix after loglevel for more intuitive parsing
---
Modified: src/core/dprint.h
---
Diff:
https://github.com/kamailio/kamailio/commit/f6f68cb91a1a1143d5cd64f7a847002…
Patch:
https://github.com/kamailio/kamailio/commit/f6f68cb91a1a1143d5cd64f7a847002…
---
diff --git a/src/core/dprint.h b/src/core/dprint.h
index 67a4ac3d7e..8a7a283875 100644
--- a/src/core/dprint.h
+++ b/src/core/dprint.h
@@ -221,10 +221,10 @@ void log_prefix_init(void);
if (unlikely(log_stderr)) { \
if (unlikely(log_color)) dprint_color(__llevel); \
if(unlikely(log_prefix_val)) { \
- fprintf(stderr, "%.*s%2d(%d) %s: %s" fmt, \
- log_prefix_val->len, log_prefix_val->s, \
+ fprintf(stderr, "%2d(%d) %s: %.*s%s" fmt, \
process_no, my_pid(), \
(lname)?(lname):LOG_LEVEL2NAME(__llevel), \
+ log_prefix_val->len, log_prefix_val->s, \
(prefix) , __VA_ARGS__);\
} else { \
fprintf(stderr, "%2d(%d) %s: %s" fmt, \
@@ -239,9 +239,9 @@ void log_prefix_init(void);
(((facility) != DEFAULT_FACILITY) ? \
(facility) : \
get_debug_facility(LOG_MNAME, LOG_MNAME_LEN)), \
- "%.*s%s: %s" fmt,\
- log_prefix_val->len, log_prefix_val->s, \
+ "%s: %.*s%s" fmt,\
(lname)?(lname):LOG_LEVEL2NAME(__llevel),\
+ log_prefix_val->len, log_prefix_val->s, \
(prefix) , __VA_ARGS__); \
} else { \
_km_log_func(LOG2SYSLOG_LEVEL(__llevel) |\
@@ -299,10 +299,10 @@ void log_prefix_init(void);
if (unlikely(log_stderr)) { \
if (unlikely(log_color)) dprint_color(__llevel); \
if(unlikely(log_prefix_val)) { \
- fprintf(stderr, "%.*s%2d(%d) %s: %s" fmt, \
- log_prefix_val->len, log_prefix_val->s, \
+ fprintf(stderr, "%2d(%d) %s: %.*s%s" fmt, \
process_no, my_pid(), \
(lname)?(lname):LOG_LEVEL2NAME(__llevel), \
+ log_prefix_val->len, log_prefix_val->s, \
(prefix) , ## args);\
} else { \
fprintf(stderr, "%2d(%d) %s: %s" fmt, \
@@ -317,9 +317,9 @@ void log_prefix_init(void);
(((facility) != DEFAULT_FACILITY) ? \
(facility) : \
get_debug_facility(LOG_MNAME, LOG_MNAME_LEN)), \
- "%.*s%s: %s" fmt,\
- log_prefix_val->len, log_prefix_val->s, \
+ "%s: %.*s%s" fmt,\
(lname)?(lname):LOG_LEVEL2NAME(__llevel),\
+ log_prefix_val->len, log_prefix_val->s, \
(prefix) , ## args); \
} else { \
_km_log_func(LOG2SYSLOG_LEVEL(__llevel) |\