This class is a sort of plug-in for the TextLogger class. Its purpose is to assemble the meta information of each log line (things like timestamps, thread information, verbosity and domain, etc.).
To manipulate the meta information log output, three options exist:
Public Fields | |
String | dateFormat = "yyyy-MM-dd" |
SimpleDateFormat | dateFormatter |
AString | format = new AString( "(%SF:%SL) %SM():%A5[%TC +%TL][%tN]%V[%D]%A1(%#): ") |
int | logNumberMinDigits = 3 |
Ticks | maxElapsedTime = new Ticks(0) |
String | timeDiffDays = " days" |
String | timeDiffHours = " h" |
String | timeDiffMicros = " \u00B5s" |
String | timeDiffMillis = " ms" |
long | timeDiffMinimum = 1000L |
Minimum time difference to log in nanoseconds. Below that timeDiffNone is written. | |
String | timeDiffMins = " m" |
String | timeDiffNanos = " ns" |
String | timeDiffNone = " 0 ns" |
Output for time difference if below reasonable (measurable) minimum defined in timeDiffMinimum. | |
String | timeDiffSecs = " s" |
String | timeElapsedDays = " Days " |
String | timeOfDayFormat = "HH:mm:ss" |
SimpleDateFormat | timeOfDayFormatter |
String | verbosityError = "[ERR]" |
String | verbosityInfo = " " |
String | verbosityVerbose = "[***]" |
String | verbosityWarning = "[WRN]" |
Protected Fields | |
boolean | calInstanceSet |
GregorianCalendar | callerDateTimeCal = new GregorianCalendar() |
Date | callerDateTimeDate = new Date() |
boolean | dateInstanceSet |
String | defaultfmtDate = "yyyy-MM-dd" |
String | defaultfmtTimeOfDay = "HH:mm:ss" |
TickSpan | elapsed = new TickSpan() |
Ticks | elapsedTime = new Ticks(0) |
FieldPosition | fieldPositionZero = new FieldPosition( 0 ) |
int[] | tempIntParameter = new int[1] |
StringBuffer | tempSBuf = new StringBuffer() |
AString | tmpAString = new AString() |
Tokenizer | tTok = new Tokenizer() |
Tokenizer used in write. | |
boolean | warnedOnce = false |
Protected Methods | |
void | processVariable (TextLogger logger, Domain domain, Verbosity verbosity, ScopeInfo scope, AString dest, Substring variable) |
void | write (TextLogger logger, AString buf, Domain domain, Verbosity verbosity, ScopeInfo scope) |
void | writeTimeDiff (AString buf, long diffNanos) |
|
protected |
Processes the next command found in the format string, by writing formatted information into the given buffer. The given Substring holds the next command. When method returns, the command is cut from the front.
logger | The logger that we are embedded in. |
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. |
scope | Information about the scope of the Log Statement.. |
dest | The buffer to write meta information into. |
variable | The variable to read (may have more characters appended) |
|
protected |
Parses the format string and logs meta information into the log buffer. For each variable found, method processVariable is invoked. Hence, to add new variables, the latter method can be overwritten by descendants. Overwriting this method is recommended for formatter classes that do not rely on format strings.
logger | The logger that we are embedded in. |
buf | The buffer to write meta information into. |
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. |
scope | Information about the scope of the Log Statement.. |
|
protected |
Helper function that logs a time given difference into the given buffer in a human readable format. Works from nano seconds to days.
buf | The buffer to write the time difference representation into. |
diffNanos | The time difference to write in nanoseconds. |
|
protected |
Flag to indicate if calendar instance was set during one logText call
|
protected |
Internal calendar object to get string representations of dates.
|
protected |
Internal calendar object to get string representations of dates.
String dateFormat = "yyyy-MM-dd" |
Format string for the output of the log date. For more information about possible, see class java.text.SimpleDateFormat
SimpleDateFormat dateFormatter |
Object to retrieve formatted log date. This field has to be set to null, when the field dateFormat gets modified and log operations have been scheduled since the creation of the Logger (respectively since the last change of that format).
|
protected |
Flag to indicate if date instance was set during one logText call
|
protected |
Internal default string to detect default format for optimized format generation
|
protected |
Internal default string to detect default format for optimized format generation
|
protected |
Internal singleton to specify a first field in formatted output
The line format specifies the (automated) log output that is prepended to each log line before the log message itself.
The string supports replacement variables that begin with a % sign
Defaults to
int logNumberMinDigits = 3 |
Prefix for the domain.
The maximum time elapsed. Used to determine the width of the output when writing the elapsed time.
This field will be read from the configuration variable ALOX_LOGGERNAME_MAX_ELAPSED_TIME when the TextLogger that this object belongs to is attached to a Lox and written back on removal.
|
protected |
Internal object to pass int parameters to methods that modify those
|
protected |
Internal object to retrieve formatted time of day
String timeDiffDays = " days" |
Format for time difference outputs of more than a day.
String timeDiffHours = " h" |
Format for time difference outputs between 1h and 24h.
String timeDiffMicros = " \u00B5s" |
Entity microseconds
String timeDiffMillis = " ms" |
Entity milliseconds
String timeDiffMins = " m" |
Format for time difference outputs between 100s and 60 min.
String timeDiffNanos = " ns" |
Entity milliseconds.
String timeDiffSecs = " s" |
Format for time difference outputs between 10s and 99.9s.
String timeElapsedDays = " Days " |
The word "Days" the out put of time elapsed (if longer than a day).
String timeOfDayFormat = "HH:mm:ss" |
Format string for the output of the time of day. For more information about possible, see class java.text.SimpleDateFormat
SimpleDateFormat timeOfDayFormatter |
Object to retrieve formatted time of day. This field has to be set to null, when the field timeOfDayFormat gets modified and log operations have been scheduled since the creation of the Logger (respectively since the last change of that format).
String verbosityError = "[ERR]" |
String verbosityVerbose = "[***]" |
String verbosityWarning = "[WRN]" |
|
protected |
Helper flag that indicates if a format warning report was already issued