TudLogger is a simple logger tool for smaller projects inspired by Android logger tools.
Add these lines to your gradle.build
:
repositories {
// ...
maven { url 'https://jitpack.io' }
}
and
dependencies {
// ...
implementation 'com.github.tudny:TudLogger:v1.1'
}
Add these lines to your build file
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
and
<dependency>
<groupId>com.github.tudny</groupId>
<artifactId>TudLogger</artifactId>
<version>v1.1</version>
</dependency>
Log (DEBUG) to standard output (System.out)
Log.d("This is my message.");
2020/12/26 20:49:58 | Debug | This is my message.
Log (ERROR) to standard error output (System.err)
Log.e("This is an error!");
2020/12/26 20:50:14 | Error | This is an error!
Log (ERROR) to standard error output (System.err) and print stack trace
Exception someException = //...//
Log.e("The World is collapsing", someException);
2020/12/26 20:50:51 | Error | The World is collapsing
java.lang.Exception: Some Exception
at com.github.tudny.tudlogger...
Change time display type
// Print milliseconds
Log.setMilis(true);
// Don't print milliseconds
Log.setMilis(false);
2020/12/26 20:49:00.5010 | Debug | This is my message without millis
2020/12/26 20:49:00 | Debug | This is my message with millis
Available in docs.