package com.orhanobut.sample;

import android.app.Activity;
import android.os.Bundle;

import com.orhanobut.logger.AndroidLogAdapter;
import com.orhanobut.logger.Logger;
import com.orhanobut.logger.PrettyFormatStrategy;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

public class MainActivity extends Activity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Logger.addAdapter(new AndroidLogAdapter());
    Logger.d("message");

    Logger.clearLogAdapters();
    PrettyFormatStrategy formatStrategy = PrettyFormatStrategy.newBuilder()
        .showThreadInfo(false)
        .build();

    Logger.addAdapter(new AndroidLogAdapter(formatStrategy));
    Logger.w("no thread info and only 1 method");

    Logger.clearLogAdapters();
    formatStrategy = PrettyFormatStrategy.newBuilder()
        .showThreadInfo(false)
        .methodCount(0)
        .build();

    Logger.addAdapter(new AndroidLogAdapter(formatStrategy));
    Logger.i("no thread info and method info");

    Logger.t("tag").e("Custom tag for only one use");

    Logger.json("{ \"key\": 3, \"value\": something}");

    Logger.d(Arrays.asList("foo", "bar"));

    Map<String, String> map = new HashMap<>();
    map.put("key", "value");
    map.put("key1", "value2");

    Logger.d(map);

    Logger.clearLogAdapters();
    formatStrategy = PrettyFormatStrategy.newBuilder()
        .showThreadInfo(false)
        .methodCount(0)
        .tag("MyTag")
        .build();
    Logger.addAdapter(new AndroidLogAdapter(formatStrategy));

    Logger.w("my log message with my tag");
  }
}

@@ -78,16 +78,41 @@
 .Bundle;
+%0Aimport android.util.Log;
 %0A%0Aimport
@@ -148,24 +148,112 @@
 LogAdapter;%0A
+import com.orhanobut.logger.DiskLogAdapter;%0Aimport com.orhanobut.logger.FormatStrategy;%0A
 import com.o
@@ -595,24 +595,223 @@
 ity_main);%0A%0A
+    Log.d(%22Tag%22, %22I'm a log which you don't see easily, hehe%22);%0A    Log.d(%22json content%22, %22%7B %5C%22key%5C%22: 3, %5Cn %5C%22value%5C%22: something%7D%22);%0A    Log.d(%22error%22, %22There is a crash somewhere or any warning%22);%0A%0A
     Logger.a
@@ -804,32 +804,35 @@
 %0A%0A    Logger.add
+Log
 Adapter(new Andr
@@ -910,18 +910,14 @@
 ();%0A
+%0A%0A
     
-Pretty
 Form
@@ -1000,32 +1000,475 @@
 hreadInfo(false)
+  // (Optional) Whether to show thread info or not. Default true%0A        .methodCount(0)         // (Optional) How many method line to show. Default 2%0A        .methodOffset(3)        // (Optional) Skips some method invokes in stack trace. Default 5%0A//        .logStrategy(customLog) // (Optional) Changes the log strategy to print out. Default LogCat%0A        .tag(%22My custom tag%22)   // (Optional) Custom tag for each log. Default PRETTY_LOGGER
 %0A        .build(
@@ -1477,32 +1477,35 @@
 %0A%0A    Logger.add
+Log
 Adapter(new Andr
@@ -1527,32 +1527,254 @@
 ormatStrategy));
+%0A%0A    Logger.addLogAdapter(new AndroidLogAdapter()%7B%0A      @Override public boolean isLoggable(int priority, String tag) %7B%0A        return BuildConfig.DEBUG;%0A      %7D%0A    %7D);%0A%0A    Logger.addLogAdapter(new DiskLogAdapter());%0A%0A
 %0A    Logger.w(%22n
@@ -1975,32 +1975,35 @@
 %0A%0A    Logger.add
+Log
 Adapter(new Andr
@@ -2562,16 +2562,19 @@
 gger.add
+Log
 Adapter(

Add more sample codes