-
Notifications
You must be signed in to change notification settings - Fork 28
Home
Muyangmin edited this page Feb 23, 2017
·
10 revisions
Please click links from the right side bar to read what you are interested in.
currently the latest version is
compile 'org.mym.plog:android-plog:${latestVersion}'
For dependencies of other modules, please click here.
Since you may need to intercept or redirect logs, in PLog 2.x version, we recommend you to prepare printers manually.
//all logs will be automatically disabled on release version
PLog.prepare(new DebugPrinter(BuildConfig.DEBUG));
Don't worry, if you forgot this, your app won't crash. You will just receive a WARNING message on the runtime, then all logs will be print to logcat only.
You can also put your customize configs before printing any logs:
PLog.init(PLogConfig.newBuilder()
.globalTag("MyApp")
.forceConcatGlobalTag(true)
.build());
Now you can use PLog
class to print log, via v()
, d()
, i()
method, and so on. Sample:
//Empty message
PLog.empty();
//log with auto tag
PLog.v("This is a verbose log.");
PLog.e("This is an error log.");
//Advanced usage
PLog.level(Log.DEBUG).tag("Scenario").category("RESULT").message("You win!").execute();
For more sample codes please see app
module on this repository.