Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
orhanobut committed Aug 2, 2015
1 parent 022e977 commit ebba488
Show file tree
Hide file tree
Showing 8 changed files with 449 additions and 435 deletions.
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: android

android:
components:
- build-tools-21.1.1
- android-18
licenses:
- 'android-sdk-license-.+'

notifications:
email: true

sudo: false

script:
- ./gradlew test
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
classpath 'com.android.tools.build:gradle:1.2.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
20 changes: 9 additions & 11 deletions logger/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
compileSdkVersion 21
buildToolsVersion "21.1.1"

defaultConfig {
minSdkVersion 8
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
defaultConfig {
minSdkVersion 8
targetSdkVersion 21
}

lintOptions {
abortOnError false
}
lintOptions {
abortOnError false
}
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion logger/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<manifest package="com.orhanobut.logger">

</manifest>
</manifest>
16 changes: 8 additions & 8 deletions logger/src/main/java/com/orhanobut/logger/LogLevel.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
*/
public enum LogLevel {

/**
* Prints all logs
*/
FULL,
/**
* Prints all logs
*/
FULL,

/**
* No log will be printed
*/
NONE
/**
* No log will be printed
*/
NONE
}
164 changes: 82 additions & 82 deletions logger/src/main/java/com/orhanobut/logger/Logger.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,87 +8,87 @@
*/
public final class Logger {

private static final Printer printer = new LoggerPrinter();
private static final String DEFAULT_TAG = "PRETTYLOGGER";

//no instance
private Logger() {
}

/**
* It is used to get the settings object in order to change settings
*
* @return the settings object
*/
public static Settings init() {
return printer.init(DEFAULT_TAG);
}

/**
* It is used to change the tag
*
* @param tag is the given string which will be used in Logger
*/
public static Settings init(String tag) {
return printer.init(tag);
}

public static Printer t(String tag) {
return printer.t(tag, printer.getSettings().getMethodCount());
}

public static Printer t(int methodCount) {
return printer.t(null, methodCount);
}

public static Printer t(String tag, int methodCount) {
return printer.t(tag, methodCount);
}

public static void d(String message, Object... args) {
printer.d(message, args);
}

public static void e(String message, Object... args) {
printer.e(null, message, args);
}

public static void e(Throwable throwable, String message, Object... args) {
printer.e(throwable, message, args);
}

public static void i(String message, Object... args) {
printer.i(message, args);
}

public static void v(String message, Object... args) {
printer.v(message, args);
}

public static void w(String message, Object... args) {
printer.w(message, args);
}

public static void wtf(String message, Object... args) {
printer.wtf(message, args);
}

/**
* Formats the json content and print it
*
* @param json the json content
*/
public static void json(String json) {
printer.json(json);
}

/**
* Formats the json content and print it
*
* @param xml the xml content
*/
public static void xml(String xml) {
printer.xml(xml);
}
private static final Printer printer = new LoggerPrinter();
private static final String DEFAULT_TAG = "PRETTYLOGGER";

//no instance
private Logger() {
}

/**
* It is used to get the settings object in order to change settings
*
* @return the settings object
*/
public static Settings init() {
return printer.init(DEFAULT_TAG);
}

/**
* It is used to change the tag
*
* @param tag is the given string which will be used in Logger
*/
public static Settings init(String tag) {
return printer.init(tag);
}

public static Printer t(String tag) {
return printer.t(tag, printer.getSettings().getMethodCount());
}

public static Printer t(int methodCount) {
return printer.t(null, methodCount);
}

public static Printer t(String tag, int methodCount) {
return printer.t(tag, methodCount);
}

public static void d(String message, Object... args) {
printer.d(message, args);
}

public static void e(String message, Object... args) {
printer.e(null, message, args);
}

public static void e(Throwable throwable, String message, Object... args) {
printer.e(throwable, message, args);
}

public static void i(String message, Object... args) {
printer.i(message, args);
}

public static void v(String message, Object... args) {
printer.v(message, args);
}

public static void w(String message, Object... args) {
printer.w(message, args);
}

public static void wtf(String message, Object... args) {
printer.wtf(message, args);
}

/**
* Formats the json content and print it
*
* @param json the json content
*/
public static void json(String json) {
printer.json(json);
}

/**
* Formats the json content and print it
*
* @param xml the xml content
*/
public static void xml(String xml) {
printer.xml(xml);
}

}
Loading

0 comments on commit ebba488

Please sign in to comment.