CustomLogger wrapper library for NSLogger
Usage:
Add it to your build.gradle with:
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
and:
dependencies {
compile 'net.intari:CustomLogger:{latest version}'
}
Call
import net.intari.CustomLogger.CustomLog;
CustomLog.setIsDebug(BuildConfig.DEBUG);//do we also need logcat? not needed if crashlytics connection is active
CustomLog.setUseCrashlytics(false);//do we need to use Crashlytics (or true if you configured it). If you don't this - crashlytics connection will not work
CustomLog.setLogDestination(LOG_HOST,LOG_PORT);//host where NSLogger is running
//MUST be called before using any function which send data to logger
CustomLog.setContext(this); // use app's context - if you don't do this - NSLogger connection will not work. if IsDebug==true and setContext was not called - it will use logcat only
..
CustomLog.e(TAG,"Message"); //level 0 in NSLogger
CustomLog.w(TAG,"Message"); //level 1 in NSLogger
CustomLog.i(TAG,"Message"); //level 2 in NSLogger
CustomLog.d(TAG,"Message"); //level 3 in NSLogger
CustomLog.v(TAG,"Message"); //level 4 in NSLogger
CustomLog.l(TAG,"Message"); //level 5 in NSLogger
CustomLog.logException(ex);//ex is Exception or Throwable
CustomLog.logException(TAG,ex);//ex is Exception or Throwable
CustomLog.logMark(mark);
...
Client app - get it from https://github.com/fpillet/NSLogger
See AndroidToolbox for Kotlin Extensions