Last active
September 12, 2017 07:50
-
-
Save Iyemon-018/66be7778140fc2fed29e493beefda3c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mc.sample.timbersample.Logs; | |
import android.util.Log; | |
import timber.log.Timber; | |
/** | |
* ログの出力先を制御するための機能クラスです。 | |
* @remarks 基本的にリリースモードはこのように独自のログ出力機構が必要になる。 | |
*/ | |
public class OriginalTree extends Timber.Tree { | |
/** | |
* 指定した宛先にログを出力します。 | |
* @param priority ログレベル。android.util.Log のログレベルが設定される。 | |
* @param tag 明示タグもしくは推定タグ。Nullの場合もある。 | |
* @param message フォーマットされたログメッセージ。Timber.d()などでしていたメッセージをフォーマットした内容。 | |
* @param t 付随する例外。Timber.e()で指定するとここに設定される。 | |
*/ | |
@Override | |
protected void log(int priority, String tag, String message, Throwable t) { | |
// これで簡易のログ出力はできる。 | |
// 以下で出力したログは、[6: Android Monitor]の"LogCat"で確認することができる。 | |
Log.println(priority, tag, message); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment