Skip to content

cescoffier/androlog

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android provides an utility class to log messages. The android.util.Log provides all the required functions.

Unfortunately, there is no easy way to alter the default log level from within your application or disable
logging altogether, although this is crucial before releasing an application. This is why you should use
androlog, which provides a class Log with the exact same API, but offers additional methods:
- deactivateLogging() : Disable all logging.
- activateLogging() : (Re-)activate logging.
- setDefaultLogLevel(int logLevel) : Set the default log level. Any level below the default level will not be logged (per default).

You can also set all log levels separately for each tag / logger (more on tags below).
By default, all logging is disabled. To enable it programmatically, use the activateLogging() method. You can also use properties
file on the SDCard to configure the loggers.

File base configuration
-----------------------
Create a file in the sdcard root directory.
Inside, define a property:
androlog.active = true
The Log class provides several log levels. For each level, a method is associated:
ERROR : Log.e
WARN : Log.w
INFO : Log.i
DEBUG : Log.d
VERBOSE : Log.v

The file name depends on the Log.init method that you call:
- init() : the file must be named androlog.properties.
- init(a_name) : the file must be named a_name.properties
- init(android_context) : the file must be named package.properties where package is your application package.

Tag Computation
---------------

Androlog defines several methods for each log level.
i(tag, message) : tag is the tag...
i(this, message) : the tag is the qualified class name of this
i(message) : the tag is computed from the current tread stack

Credits
-------
Androlog is an open source project licensed under the Apache License 2.0. IT is founded by akquinet (http://akquinet.de/en)

About

androlog is a customizable Log replacement for Android

Resources

License

Stars

Watchers

Forks

Packages

No packages published