package com.ns.greg.fancylogger;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import com.ns.greg.library.fancy_logger.FancyLogger;
import com.ns.greg.library.fancy_logger.Printer;

/**
 * Created by Gregory on 2017/7/21.
 */

public class DemoActivity extends AppCompatActivity {

  @Override protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Using default way
    FancyLogger.add(FancyLogger.HIGH_PRIORITY, new Printer.Builder().build());
    // Custom printer
    FancyLogger.add(FancyLogger.LOW_PRIORITY, new Printer.Builder().setMethodOffset(2)
        .showThreadInfo(false)
        .log2File(getApplicationContext(), "Demo_")
        .build());

    FancyLogger.i("DEMO", "onCreate", FancyLogger.HIGH_PRIORITY);

    String message = "============DEVICE INFO==============="
        + "\n"
        + "Title 1: A"
        + "\n"
        + "Title 2: B"
        + "\n"
        + "Title 3: C"
        + "\n"
        + "Title 4: D"
        + "\n"
        + "Title 5: E"
        + "\n"
        + "Title 6: F"
        + "\n"
        + "Title 7: G"
        + "\n"
        + "Title 8: H";

    FancyLogger.d("DEMO", message, FancyLogger.NORMAL_PRIORITY);

    FancyLogger.d("DEMO",
        "{\"person\":[{\"name\":Greg, \"sex\":man, \"age\":26}, {\"name\":Natalie, \"sex\":woman, \"age\":24}]}");

    FancyLogger.e("DEMO", "Fancy Logger log to the file!", FancyLogger.LOW_PRIORITY);
  }
}

@@ -260,29 +260,33 @@
 %0A * 
-Created by Gregory on
+@author Gregory%0A * @since
  201
@@ -291,17 +291,16 @@
 017/7/21
-.
 %0A */%0A%0Apu
@@ -517,36 +517,35 @@
 add(FancyLogger.
-HIGH
+LOW
 _PRIORITY, new P
@@ -708,12 +708,11 @@
 nfo(
-fals
+tru
 e)%0A 
@@ -778,24 +778,46 @@
 .build());%0A%0A
+    // Normal message%0A
     FancyLog
@@ -874,442 +874,19 @@
 Y);%0A
-%0A
     
-String message = %22============DEVICE INFO===============%22%0A        + %22%5Cn%22%0A        + %22Title 1: A%22%0A        + %22%5Cn%22%0A        + %22Title 2: B%22%0A        + %22%5Cn%22%0A        + %22Title 3: C%22%0A        + %22%5Cn%22%0A        + %22Title 4: D%22%0A        + %22%5Cn%22%0A        + %22Title 5: E%22%0A        + %22%5Cn%22%0A        + %22Title 6: F%22%0A        + %22%5Cn%22%0A        + %22Title 7: G%22%0A        + %22%5Cn%22%0A        + %22Title 8: H%22;%0A%0A    FancyLogger.d(%22DEMO%22, message, FancyLogger.NORMAL_PRIORITY);%0A
+// Json
 %0A   
@@ -1023,16 +1023,39 @@
 4%7D%5D%7D%22);%0A
+    // Long Json String
 %0A    Fan
@@ -1063,17 +1063,17 @@
 yLogger.
-e
+v
 (%22DEMO%22,
@@ -1078,64 +1078,712 @@
 %22, %22
-Fancy Logger log to the file!%22, FancyLogger.LOW_PRIORITY
+%7B%5Cn%22%0A        + %22  %5C%22a%5C%22: %5C%22aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%5C%22,%5Cn%22%0A        + %22  %5C%22b%5C%22: %5C%22bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb%5C%22,%5Cn%22%0A        + %22  %5C%22c%5C%22: %5C%22cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc%5C%22%5Cn%22%0A        + %22%7D%22
 );%0A 

Update demo