Skip to content
/ log.L Public

simple, pretty and custom log print for android

Notifications You must be signed in to change notification settings

ymex/log.L

Repository files navigation

Download

log.L

Log printer for Android

Use in Android Studio

compile 'cn.ymex:log.L:1.2.0'

Sample Usage

L.i(TAG,"log message");
L.v("log message");

L.tag().logD(message,message2,message3);
L.tag(TAG).logW(Data.object());

L.e(Data.array());
...

Refer to the sample

Question

what is Log default TAG?

 public static String TAG = "cute.L";//default tag

how to set tag ?

L.d(tag,message);

why my Android studio Logcat has no color ?

you need set android studio color in: File > Settings > Editor > Colors &Fonts -> Android Logcat check off Use Inberited attributes, then check Foreground ,check Foreground, click Foreground color selecter。

Demo color:

Tag Value
Verbose #F9BDBB
Info #B39DDB
Debug #738FFE
warning #EF6C00
Error #E00032
Assert #FF1696

Log print format disorder ?

setting Android studio Console font size。 Editor>Colors&Fonts>Console Font

close log printer?

L.setLOG(false);

Custom log print format ?

you need extend Printer and implement the following method:

    public abstract String logHeader();//log header
    public abstract String logFooter();//log footer
    public abstract String logContent(Object message);//log content

set L.setPrinter(new CustomerPrinter());

Want a simple print format?

L.setPrinter(new SimplePrinter());

capture picture

  • Base type

  • Object type

  • List type

  • Map type

  • Array type

About

simple, pretty and custom log print for android

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages