Adjust the default logformat.
The file, line and function information is now only printed for error and debug messages.
This commit is contained in:
parent
ea3f833d8d
commit
55c16d0d0f
@ -58,5 +58,9 @@ logfunc (dc_context_t *context, dc_loglevel_t loglevel, const char *file, unsign
|
||||
{
|
||||
const char *loglevels[] = {"NONE", "ERROR", "WARNING", "INFO", "DEBUG", "ALL"};
|
||||
|
||||
message ("%s: %s [in %s:%d (%s)]\n", loglevels[loglevel], msg, file, line, function);
|
||||
if (loglevel == DC_LOGLEVEL_ERROR || loglevel == DC_LOGLEVEL_WARNING) {
|
||||
message ("%s: %s [in %s:%d (%s)]\n", loglevels[loglevel], msg, file, line, function);
|
||||
} else {
|
||||
message ("%s: %s\n", loglevels[loglevel], msg);
|
||||
}
|
||||
}
|
||||
|
||||
@ -126,7 +126,11 @@ logfunc (dc_context_t *context, dc_loglevel_t loglevel, const char *file, unsign
|
||||
{
|
||||
const char *loglevels[] = {"NONE", "ERROR", "WARNING", "INFO", "DEBUG", "ALL"};
|
||||
|
||||
fprintf (stderr, "%s: %s [in %s:%d (%s)]\n", loglevels[loglevel], msg, file, line, function);
|
||||
if (loglevel == DC_LOGLEVEL_ERROR || loglevel == DC_LOGLEVEL_WARNING) {
|
||||
fprintf (stderr, "%s: %s [in %s:%d (%s)]\n", loglevels[loglevel], msg, file, line, function);
|
||||
} else {
|
||||
fprintf (stderr, "%s: %s\n", loglevels[loglevel], msg);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user