Skip to content

L class is a wrapper of Log class to print detail logs with short syntax in Adb LogCat.

License

Notifications You must be signed in to change notification settings

sokunmin/android-easy-logcat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

L class is a wrapper of Log class to print log easier and show more details in Adb LogCat.

  • Append text with String.format() implicitly.
  • Log shows line number, method name, custom tag and messages.
  • Adjust the depth to get super method name.

How to

Use `L.d(), L.i(), L.w() and L.e()` instead of `Log.d(), Log.i(), Log.w() and Log.e()`.

Sample

```java MainActivity.java

public void onCreate() { testLevel(); }

void testLevel() { L.d(); L.i(this); L.w("CustomTag"); L.e(this, "[%d] L.e(%s)", 1, "DEBUG"); L.d("[%d] L.d(%s)", 2, "DEBUG"); L.i(1, "Text isNull? %s", L.isNull(mTest)); L.w(1, "Text2 isNull? %s", L.isNull(mTest2)); }


<H2>Result</H2>
<pre>
D/[(29)testLevel()] =>﹕ ----------
I/[(30)MainActivity / testLevel()] =>﹕ ----------
W/[(31)CustomTag / testLevel()] =>﹕ ----------
E/[(32)MainActivity / testLevel()] =>﹕ [1] L.e(DEBUG)
D/[(33)testLevel()] =>﹕ [2] L.d(DEBUG)
I/[(34)/(19)onCreate()] =>﹕ Text isNull? null
W/[(35)/(19)onCreate()] =>﹕ Text2 isNull? String not null
</pre>

About

L class is a wrapper of Log class to print detail logs with short syntax in Adb LogCat.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages