From e54d48f5d9513e2566e44632d665b9fcee919845 Mon Sep 17 00:00:00 2001 From: Lachlan McKee Date: Sun, 19 Nov 2017 19:14:56 +0000 Subject: [PATCH] Updated changelog and maven config --- CHANGELOG.md | 2 +- README.md | 24 +++++++++++++++++++++++- gradle.properties | 8 ++++---- timber-junit/gradle.properties | 4 ++-- 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3464532..28e89a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ Change Log ========== -Version 1.0.0 *(2017-05-21)* +Version 1.0.0 *(2017-11-19)* ---------------------------- * Initial release \ No newline at end of file diff --git a/README.md b/README.md index 426e8f4..72162bf 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,31 @@ This library provides a JUnit TestRule that plants a temporary Timber tree that pipes any logs sent via Timber to the standard System.out. Once a unit test has completed, the Timber tree is removed to avoid logging unintended test cases. +## Usage +Using the library is very straight forward. An example is as follows: + +```java +public class TestExample { + @Rule + public TimberTestRule mTimberTestRule = TimberTestRule.builder() + .minPriority(Log.ERROR) + .showThread(true) + .showTimestamp(false) + .onlyLogWhenTestFails(true) + .build(); +} +``` + +### Configuration +As seen in the example above, there are many ways to modify the output using the following behaviours: +- The minimum log level to output. +- Whether thread ids are shown. +- Whether timestamps are shown. +- Whether to always log, or only log when a unit test fails. + ## Download This library is available on Maven, you can add it to your project using the following gradle dependencies: ```gradle -testCompile 'net.lachlanmckee:timber-junit:1.0.0' +testCompile 'net.lachlanmckee:timber-junit-rule:1.0.0' ``` diff --git a/gradle.properties b/gradle.properties index 15a4544..eef2454 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,10 +3,10 @@ VERSION_NAME=1.0.0 POM_DESCRIPTION=JUnit TestRule that pipes Android Timber logs to the standard console -POM_URL=https://github.com/LachlanMcKee/timber-junit -POM_SCM_URL=https://github.com/LachlanMcKee/timber-junit -POM_SCM_CONNECTION=scm:git:git://github.com/LachlanMcKee/timber-junit.git -POM_SCM_DEV_CONNECTION=scm:git:git://github.com/LachlanMcKee/timber-junit.git +POM_URL=https://github.com/LachlanMcKee/timber-junit-rule +POM_SCM_URL=https://github.com/LachlanMcKee/timber-junit-rule +POM_SCM_CONNECTION=scm:git:git://github.com/LachlanMcKee/timber-junit-rule.git +POM_SCM_DEV_CONNECTION=scm:git:git://github.com/LachlanMcKee/timber-junit-rule.git POM_LICENCE_NAME=MIT License POM_LICENCE_URL=http://www.opensource.org/licenses/mit-license.php diff --git a/timber-junit/gradle.properties b/timber-junit/gradle.properties index 68db22d..f52d635 100644 --- a/timber-junit/gradle.properties +++ b/timber-junit/gradle.properties @@ -1,3 +1,3 @@ -POM_ARTIFACT_ID=timber-junit -POM_NAME=Timber-JUnit +POM_ARTIFACT_ID=timber-junit-rule +POM_NAME=Timber-JUnit-Rule POM_PACKAGING=aar \ No newline at end of file