Customizable log levels
Closed this issue · 4 comments
I'm looking for a way to customize log levels. E.g. we don't use verbose
but we do use critical
(higher than error). Currently all I can do is "transpose" the log levels with a wrapper and an interceptor or something making everything a mess (and stack traces incorrect because the wrapper is irrelevant).
@verheyenkoen Can you show part of the code("transpose" the log levels with a wrapper and an interceptor) so I can understand what you want better?
@elvishew I don't actually do it as it's ugly, but I mean some kind of Log class that wraps around XLog with methods that would look like this:
public static void d(...) {
XLog.v(...);
}
Then with an interceptor reverse those levels in a switch statement and then with a log Printer object send the log entries to our backend.
It would be nice if there would be something like this that would just pass on my log level value:
XLog.log(MY_CUSTOM_LOG_LEVEL, msg);
@verheyenkoen Sounds cool, I will do it.
@verheyenkoen It is available in the latest release(1.4.0).