Search code examples
androidlogcat

Possible to have custom logs in logcat?


I'm using logcat for monitoring my android projects in a custom way. I export my data,errors,method info and many other options.
I prefer to not to use Log defaults like Lod.d or Log.e or etc.
Is it possible to have my own custome logs for example Log.myLog with a new color in Logcat?
I prefer my logs do not interfere with android logs. I've searched a lot but can't find anything about this purpose: http://wiki.cyanogenmod.org/w/Doc:_debugging_with_logcat
http://logc.at/


Solution

  • I can recommend you a good one: https://github.com/oronno/log4android

    Features

    • Log syntax similar with popular log4j framework
    • Automatically added TAG with log message
    • Derive TAG from the package name
    • Can disable logging by simply calling Logger.disableLogging(true) method preferably from the class extends Application.
    • Fully Qualified Class name or SimpleClassName will logged as prefix with log message
    • Variable Arguments (more than 2) can be passed for printing unlike log4j framework
    • Very lightweight, < 5KB library size!

    I do use it in my every android application.