In the Android development process, the log printing is essential, below to recommend a github on the open source log framework-logger
Advantage
- Accurate location and related information display of the thread, class and method of the log
- Beautiful print output format
- Supports print output in JSON and XML format
- Support for jumping from print to corresponding code
- Multiple log output levels (. d. e. W. V)
Add a reference to Android Studio-gradle
‘com.orhanobut:logger:1.11‘
Eclipse
This
Example of simple code output
Logger.d("hello");Logger.d("hello %s %d""world"5); // 支持String.format
More sample output
Logger.d("hello");Logger.e"message");Logger.json(JSON_CONTENT);
Information configuration
Logger .init(YOUR_TAG) // 日志显示的Tag值 .setMethodCount(3) // 输出方法数 默认值为2 .hideThreadInfo() // 隐藏线程信息 默认显示 .setLogLevel(LogLevel.NONE // 设置Log级别 默认为LogLevel.FULL .setMethodOffset(2) // 输出方法层级 默认值为0
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android Log Output-logger