diff --git a/README.md b/README.md index b11367ea..296d526e 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Logger provides : ### Gradle ```groovy -compile 'com.orhanobut:logger:1.8' +compile 'com.orhanobut:logger:1.9' ``` ### Current Log system diff --git a/app/build.gradle b/app/build.gradle index cee0bc9b..80bbf1ba 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -22,6 +22,5 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:21.0.3' - // compile project(':logger') - compile 'com.orhanobut:logger:1.5' + compile project(':logger') } diff --git a/app/src/main/java/com/orhanobut/loggersample/MainActivity.java b/app/src/main/java/com/orhanobut/loggersample/MainActivity.java index 70148b08..6daff933 100644 --- a/app/src/main/java/com/orhanobut/loggersample/MainActivity.java +++ b/app/src/main/java/com/orhanobut/loggersample/MainActivity.java @@ -16,7 +16,7 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); - Logger.init("test").hideThreadInfo().setMethodCount(40); + Logger.init("test").hideThreadInfo().setMethodCount(0); printNormalLog(); printPretty(); @@ -27,7 +27,6 @@ void printNormalLog() { Log.v(TAG, "i = 0 + 1"); Log.v(TAG, Dummy.JSON_WITH_NO_LINE_BREAK); Log.v("test", Dummy.JSON_WITH_LINE_BREAK); - } void printPretty() { @@ -45,6 +44,8 @@ void printPretty() { Logger.json(Dummy.SMALL_SON_WITH_NO_LINE_BREAK); Logger.d("test"); + + Logger.t("TEST", 3).d("asdfasdf"); } void test2() { diff --git a/gradle.properties b/gradle.properties index 2720b1d4..ae9fbe17 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,8 +18,8 @@ # org.gradle.parallel=true #VERSION_NAME=1.0-SNAPSHOT -VERSION_NAME=1.8 -VERSION_CODE=9 +VERSION_NAME=1.9 +VERSION_CODE=10 GROUP=com.orhanobut POM_DESCRIPTION=Simple,pretty and powerful log diff --git a/logger/src/main/java/com/orhanobut/logger/Logger.java b/logger/src/main/java/com/orhanobut/logger/Logger.java index 46484c90..8cf03f1a 100644 --- a/logger/src/main/java/com/orhanobut/logger/Logger.java +++ b/logger/src/main/java/com/orhanobut/logger/Logger.java @@ -9,7 +9,6 @@ public final class Logger { private static final Printer printer = new LoggerPrinter(); - private static final int DEFAULT_METHOD_COUNT = 2; private static final String DEFAULT_TAG = "PRETTYLOGGER"; //no instance @@ -35,7 +34,7 @@ public static Settings init(String tag) { } public static Printer t(String tag) { - return printer.t(tag, DEFAULT_METHOD_COUNT); + return printer.t(tag, printer.getSettings().getMethodCount()); } public static Printer t(int methodCount) { diff --git a/logger/src/main/java/com/orhanobut/logger/LoggerPrinter.java b/logger/src/main/java/com/orhanobut/logger/LoggerPrinter.java index fa46b603..1ccbffcc 100644 --- a/logger/src/main/java/com/orhanobut/logger/LoggerPrinter.java +++ b/logger/src/main/java/com/orhanobut/logger/LoggerPrinter.java @@ -90,6 +90,11 @@ public Settings init(String tag) { return settings; } + @Override + public Settings getSettings() { + return settings; + } + @Override public Printer t(String tag, int methodCount) { if (tag != null) { diff --git a/logger/src/main/java/com/orhanobut/logger/Printer.java b/logger/src/main/java/com/orhanobut/logger/Printer.java index 7d40038d..c5eac503 100644 --- a/logger/src/main/java/com/orhanobut/logger/Printer.java +++ b/logger/src/main/java/com/orhanobut/logger/Printer.java @@ -9,6 +9,8 @@ public interface Printer { Settings init(String tag); + Settings getSettings(); + void d(String message, Object... args); void e(String message, Object... args);