AndroidBaseUtils
AndroidBaseUtils copied to clipboard
LogUtil
It would be nice to have a LogUtil (that prints messages in a pretty way) in this library.
This sounds great! I would like to design proper API for LogUtil
. Here is my thought about it! Let me know if you have any idea to add or if you don't like some part of the design.
Class name: LogUtil
Set Defaults Methods
-
LogUtil.setDefaultTag(String tag);
-
LogUtil.setDefaultShowThreadInfo(boolean show);
-
LogUtil.setDefaultShowMethods(int count);
Builder Methods
-
LogUtil.tag(String tag)
-
LogUtil.showThreadInfo()
-
LogUtil.showThreadInfo(boolean show)
-
LogUtil.showMethods(int count)
Log Methods:
-
LogUtil.v(...);
-
LogUtil.d(...);
-
LogUtil.i(...);
-
LogUtil.w(...);
-
LogUtil.e(...);
-
LogUtil.wtf(...);
-
LogUtil.json(String jsonString);
Parameters:
-
byte
-
char
-
short
-
int
-
long
-
float
-
double
-
boolean
-
JsonObject
-
Exception
What to show
- Tag: default as class name
- Thread Information: main/background, thread id
- Methods stack
User case
LogUtil.v("Hello World");
LogUtil.showThreadInfo().v("Hello World");
That's perfect. I'm looking forward to it.
@ugurcany I might be able to finish this util today. Updating it https://github.com/TheFinestArtist/AndroidBaseUtils/commit/bb3540b5205ed1f8f42e96dfdb6a01a659aeea26 I will get back to Annotation Processor problem after this!
@ugurcany Check the API out. It's almost done! https://github.com/TheFinestArtist/AndroidBaseUtils#logutil- https://github.com/TheFinestArtist/AndroidBaseUtils#loghelper-
@ugurcany Released 0.8.6
Add logging to file. After creating FileUtil
.
Hi, I have a suggestion: You can add separator lines at the start and end of each log to be able to separate logs easily from each other when we look at them.
For an inspiration, see this library: https://github.com/orhanobut/logger
@ugurcany Surely, I will add this feature!
@ugurcany Released 0.9.2
Perfect! Thanks.
Is there any way to disable all log before release? I set log level to NONE but it does not work.
@IHNEL The log level to NONE
is the intension for disable all log. I think log level doesn't work as I expected. Let me check!
@IHNEL Released 0.9.3 which fixed LogLevel
issue!
Thank you for fast responding. It works fine now.