Skip to content

Instantly share code, notes, and snippets.

@Iyemon-018
Created September 12, 2017 07:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Iyemon-018/c0cf583afd99f2eef6f22ff6e87d5449 to your computer and use it in GitHub Desktop.
Save Iyemon-018/c0cf583afd99f2eef6f22ff6e87d5449 to your computer and use it in GitHub Desktop.
package com.mc.sample.timbersample.Logs;
import timber.log.Timber;
/**
* アプリケーション固有のログ出力機能クラスです。
*.このように、基本的にログの出力機構をラップして作成する。
*/
public class Logger {
/**
* 初期化処理を実施します。
* @remarks 実行モードによって出力方式を調節します。
* 例えばデバッグモード専用のログであればコンソールに出力し、
* リリースモードであればファイルに出力するようのツリー機能を設定するなど、
*/
public static void initialize() {
Timber.plant(new OriginalTree());
}
public static void d(String message, Object... args) {
Timber.d(message, args);
}
public static void i(String message, Object... args) {
Timber.i(message, args);
}
public static void w(String message, Object... args) {
Timber.w(message, args);
}
public static void e(String message, Object... args) {
Timber.e(message, args);
}
public static void e(Throwable t ,String message, Object... args) {
Timber.e(t, message, args);
}
public static void wtf(Throwable t, String message, Object... args) {
Timber.wtf(t, message, args);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment