A logger that logs all messages to the Java console using System.out.print() or alternatively (if available) the PrintWriter object returned by System.console(). The latter is used if it is available and will lead to a different character encoding (typically on Windows operating system). The configuration variable ALOX_USE_SYSTEM_OUT_PRINT can be used to force the use of System.out..
The name of the Logger defaults to "CONSOLE".
Public Fields | |
PrintWriter | writer |
![]() | |
boolean | pruneESCSequences = true |
![]() | |
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 |
![]() | |
int | cntLogs |
Ticks | timeOfCreation = new Ticks() |
Ticks | timeOfLastLog = new Ticks() |
![]() | |
int | recursionWarningThreshold = 10 |
int | waitWarningTimeLimitInMillis = 1000 |
Public Methods | |
ConsoleLogger () | |
ConsoleLogger (String name) | |
![]() | |
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) |
![]() | |
String | getName () |
String | getTypeName () |
String | toString () |
![]() | |
SmartLock () | |
int | cntAcquirers () |
![]() | |
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 | constructor () |
boolean | logSubstring (AString buffer, int start, int length) |
boolean | notifyLogOp (Phase phase) |
void | notifyMultiLineOp (Phase phase) |
![]() | |
PlainTextLogger (String name, String typeName, boolean usesStdStreams) | |
void | logText (Domain domain, Verbosity verbosity, AString msg, ScopeInfo scope, int lineNumber) |
![]() | |
TextLogger (String name, String typeName, boolean usesStdStreams) | |
![]() | |
Logger (String name, String typeName) | |
Additional Inherited Members | |
![]() | |
AString | logBuf = new AString( 256 ) |
AString | msgBuf = new AString( 128 ) |
ArrayList< String > | replacements = new ArrayList<String>() |
int | stdStreamLockRegistrationCounter =0 |
boolean | usesStdStreams |
![]() | |
String | name |
String | typeName |
![]() | |
ArrayList< ThreadLock > | acquirers = new ArrayList<ThreadLock>() |
![]() | |
int | cntAcquirements |
boolean | createOwnerStackTrace = false |
LockMode | lockMode |
Object | mutex |
Thread | owner |
Exception | ownerException |
Ticks | waitTime = new Ticks() |
![]() | |
void | constructor (LockMode lockMode, Safeness safeness) |
ConsoleLogger | ( | String | name | ) |
Creates a ConsoleLogger with the given name.
name | The name of the Logger, defaults to "CONSOLE". |
ConsoleLogger | ( | ) |
Creates a ConsoleLogger with the name "CONSOLE".
|
protected |
Used by the constructors to perform common initialization tasks.
|
protected |
Write the given region of the given AString to the destination buffer.
buffer | The string to write a portion of. |
start | The start of the portion in buffer to write out. |
length | The length of the portion in buffer to write out. |
Reimplemented from PlainTextLogger.
|
protected |
Start a new log line. Appends a new-line character sequence to previously logged lines.
phase | Indicates the beginning or end of a log operation. |
Reimplemented from PlainTextLogger.
|
protected |
Empty, not needed here
phase | Indicates the beginning or end of a multi-line operation. |
Reimplemented from TextLogger.
PrintWriter writer |
Retrieved using System.console().writer(). See class description for more information.
Can also be set from outside to redirect output to any PrintWriter type.