A logger that logs all messages to the Android LogCat (using * android.util.Log.e()/w()...) There are two options to use the LogCat "Tag" concept together with the ALox "Log Domain" concept. See public field logTag for more information.
The name of the Logger defaults to "LOGCAT". In the Eclipse IDE, log lines are double-clickable to jump directly to the source code that generated the log.
Public Fields | |
String | logTag ="ALox" |
boolean | verboseIsDebug = true |
Public Fields inherited from TextLogger | |
AutoSizes | autoSizes = new AutoSizes() |
ObjectConverter | converter |
String | fmtMsgSuffix ="" |
String | fmtMultiLineMsgHeadline ="ALox: Multi line message follows: " |
String | fmtMultiLinePrefix = ">> " |
String | fmtMultiLineSuffix = null |
MetaInfo | metaInfo = new MetaInfo() |
String | multiLineDelimiter = null |
String | multiLineDelimiterRepl = "\\r" |
int | multiLineMsgMode = 2 |
Public Fields inherited from Logger | |
int | cntLogs |
Ticks | timeOfCreation = new Ticks() |
Ticks | timeOfLastLog = new Ticks() |
Public Fields inherited from ThreadLock | |
int | recursionWarningThreshold = 10 |
int | waitWarningTimeLimitInMillis = 1000 |
Public Methods | |
AndroidLogCatLogger () | |
AndroidLogCatLogger (String name) | |
void | constructor () |
Public Methods inherited from TextLogger | |
int | addAcquirer (ThreadLock newAcquirer) |
void | clearReplacements () |
void | log (Domain domain, Verbosity verbosity, ArrayList< Object > logables, ScopeInfo scope) |
int | removeAcquirer (ThreadLock acquirer) |
void | resetAutoSizes () |
void | setReplacement (String searched, String replacement) |
Public Methods inherited from Logger | |
String | getName () |
String | getTypeName () |
String | toString () |
Public Methods inherited from SmartLock | |
SmartLock () | |
int | cntAcquirers () |
Public Methods inherited from ThreadLock | |
ThreadLock () | |
ThreadLock (LockMode lockMode) | |
ThreadLock (LockMode lockMode, Safeness safeness) | |
void | acquire () |
int | dbgCountAcquirements (Thread thread) |
LockMode | getMode () |
Safeness | getSafeness () |
void | release () |
void | setSafeness (Safeness safeness) |
boolean | willRelease () |
Protected Methods | |
void | logText (Domain domain, Verbosity verbosity, AString msg, ScopeInfo caller, int lineNumber) |
void | notifyMultiLineOp (Phase phase) |
Protected Methods inherited from TextLogger | |
TextLogger (String name, String typeName, boolean usesStdStreams) | |
Protected Methods inherited from Logger | |
Logger (String name, String typeName) | |
Additional Inherited Members | |
Protected Fields inherited from TextLogger | |
AString | logBuf = new AString( 256 ) |
AString | msgBuf = new AString( 128 ) |
ArrayList< String > | replacements = new ArrayList<String>() |
int | stdStreamLockRegistrationCounter =0 |
boolean | usesStdStreams |
Protected Fields inherited from Logger | |
String | name |
String | typeName |
Protected Fields inherited from SmartLock | |
ArrayList< ThreadLock > | acquirers = new ArrayList<ThreadLock>() |
Protected Fields inherited from ThreadLock | |
int | cntAcquirements |
boolean | createOwnerStackTrace = false |
LockMode | lockMode |
Object | mutex |
Thread | owner |
Exception | ownerException |
Ticks | waitTime = new Ticks() |
Package Access Methods inherited from ThreadLock | |
void | constructor (LockMode lockMode, Safeness safeness) |
AndroidLogCatLogger | ( | String | name | ) |
Creates an AndroidLogCatLogger with name "LOGCAT".
void constructor | ( | ) |
Sets the format string to be right for LogCat.
|
protected |
The implementation of the abstract method of parent class TextLogger. Logs messages to android LogCat (which might be an IDE window)
domain | The Log Domain. |
verbosity | The verbosity. This has been checked to be active already on this stage and is provided to be able to be logged out only. |
msg | The log message. |
caller | Information about the scope of the Log Statement.. |
lineNumber | The line number of a multi-line message, starting with 0. For single line messages this is -1. |
Reimplemented from TextLogger.
|
protected |
Abstract method to be implemented by descendants. This message is called only when multi-line messages are logged. It is called exactly once before a series of logText calls of a multi-line message and exactly once after such series.
This is useful if the writing of text includes the acquisition of system resources (e.g. opening a file).
phase | Indicates the beginning or end of a multi-line operation. |
Reimplemented from TextLogger.
String logTag ="ALox" |
The log tag that is passed to LogCat. If this is set to null, the ALox domain name is passed instead. The advantage of having one fixed LogCat tag value for all ALox messages is that you can filter that tag within your IDE's LogCat view to see exclusively ALox messages. On the other hand, if the ALox domain name is used as the LogCat category, than you can use the LogCat view to filter ALox messages. Default value is "ALox". If you set this to null to switch to the other mode, you might want to also change the format string to NOT redundantly include the domain name, which then is presented by LogCat (e.g. change it to "at (%SF) %SM():%A3[%TC +%TL]: ".
boolean verboseIsDebug = true |
Flag to indicate whether ALox Verbosity.Verbose should be logged using android.util.Log.d or android.util.Log.v. Defaults to true, hence LogCat debug messages are used.