novoda/notils

Remove interfacing and object creation from logging calls

Closed this issue · 2 comments

The current implementation relies on an interface and object creation for each log message which is way of an overhead for a logger - think logging on touch events would blow up object creation. We should not use such implementation in production code. Instead we could either rely on compile time manipulation (ala aop) to exchange the logger or have a very simple switch at runtime on getInstance (no need for synchronization either)

👍 I still think the library should be simplified so you can import the Android module (with the Android logger) or the Java module - that way we can also have scala modules etc

I think the main idea is to have logging in core so we should be able to set a global static instance of the logger to Android.Logger or Java.Logger - either at compile time or runtime. We should still follow the if(Log.isEnable) {} principle. BTW proguard also remove Log.d and Log.v if you ask him nicely :)