noveogroup / android-logger

Useful logger for Android based on standard android.util.Log class. Simple lightweight (< 50 Kb) implementation of SLF4J API. Easy but powerful configuration via properties file and some additional helpful logging methods. Easy analogue of popular log4j library.

Home Page:https://noveogroup.github.io/android-logger

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

%caller and %source do not work properly with slf4j

almilli opened this issue · comments

When using the SLF4J bindings, both %caller and %source always results in AndroidLoggerAdapter as the caller/source instead of the actual class that the SLF4J log call was done in.

#android-logger.properties file
logger.com.example=DEBUG:Example:[%t] %caller{-3.-15}%source
//SLF4J test
private static final Logger log = LoggerFactory.getLogger(MainActivity.class);

public void doTest() {
    log.info("Testing");
}
05-19 09:23:45.129 736-804/com.example.activity D/Syncronous: [main] AndroidLoggerAdapter#log:55(AndroidLoggerAdapter.java:55) Testing