logger
logger copied to clipboard
print twice
Please try to fill all questions below before submitting an issue.
-
Android studio version:3.1.3
-
Android gradle plugin version:4.4
-
Logger version:2.2.0
-
Emulator/phone information:
-
If possible, please add how did you initialize Logger? protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); initData(); // log初始化 // CsvFormatStrategy strategy = CsvFormatStrategy.newBuilder() // .tag("custom") // .build(); Logger.addLogAdapter(new AndroidLogAdapter());
// 将对象以类似json格式输出 Logger.d(data); // 将json字符串输出 JSONArray jsonArray = new JSONArray(data); Logger.json(jsonArray.toString()); Log.e(TAG, "onCreate: ");
}
-
Is it flaky or does it happen all the time? if I just finish the mainActivity,when I start the activity,will print twice.Unless I kill the app,clean the background,then it prints normal.But the Android's API log alway normal.
Only I initialize Logger in Application,it's OK.I'm confused, if it initializes in Activity's onCreat(),it seems addLogAdapter execute twice.
I'm also facing same issue How to resolve it It's log twice
Same issue. I solved the problem adding
Logger.addLogAdapter(AndroidLogAdapter())
in my child activity MainActivity and not in the abstract BaseActivity
I have the same question .now ,I kown that what is the reason ,beycause i call Logger.addLogAdapter(AndroidLogAdapter())
twice in deferent place , So I delete one of them