mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-19 11:09:42 +00:00
Add MG_ENABLE_CUSTOM_LOG
This commit is contained in:
1 parent
e357cb3185
commit
ea2ff010a9
4 files changed
+16
No files matched your search
@@ -3217,6 +3217,9 @@ void mg_log_set(int log_level) {
|
||||
s_level = log_level;
|
||||
}
|
||||
|
||||
#if MG_ENABLE_CUSTOM_LOG
|
||||
// Let user define their own mg_log_prefix() and mg_log()
|
||||
#else
|
||||
bool mg_log_prefix(int level, const char *file, int line, const char *fname) {
|
||||
if (level <= s_level) {
|
||||
const char *p = strrchr(file, '/');
|
||||
@@ -3241,6 +3244,7 @@ void mg_log(const char *fmt, ...) {
|
||||
va_end(ap);
|
||||
logs("\r\n", 2);
|
||||
}
|
||||
#endif
|
||||
|
||||
static unsigned char nibble(unsigned c) {
|
||||
return (unsigned char) (c < 10 ? c + '0' : c + 'W');
|
||||
|
||||
Reference in new issue
Block a user