Better log trace

This commit is contained in:
cpq 2021-04-13 21:02:05 +01:00
parent e217066bf6
commit 1b8624f135
2 changed files with 2 additions and 0 deletions

View File

@ -1445,6 +1445,7 @@ bool mg_log_prefix(int level, const char *file, int line, const char *fname) {
int max = LL_INFO;
struct mg_str k, v, s = mg_str(s_spec);
const char *p = strrchr(file, '/');
if (p == NULL) p = strrchr(file, '\\');
p = p == NULL ? file : p + 1;
if (s_fn == NULL) return false;

View File

@ -23,6 +23,7 @@ bool mg_log_prefix(int level, const char *file, int line, const char *fname) {
int max = LL_INFO;
struct mg_str k, v, s = mg_str(s_spec);
const char *p = strrchr(file, '/');
if (p == NULL) p = strrchr(file, '\\');
p = p == NULL ? file : p + 1;
if (s_fn == NULL) return false;