Package com.glitchybyte.glib.log
Class GLogFormatter
java.lang.Object
java.util.logging.Formatter
java.util.logging.SimpleFormatter
com.glitchybyte.glib.log.GLogFormatter
- Direct Known Subclasses:
GColorLogFormatter,GStandardLogFormatter
Base log formatter class.
Uses a compact time format and shows thread name. Made to log one-liners (except for exceptions).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidapplyClassName(StringBuilder sb, String value) Applies theclassNamevalue to the log being built by the givenStringBuilder.protected abstract voidapplyDateTime(StringBuilder sb, String value) Applies thedatetimevalue to the log being built by the givenStringBuilder.protected abstract voidapplyLevel(StringBuilder sb, String value) Applies thelevelvalue to the log being built by the givenStringBuilder.protected abstract voidapplyMessage(StringBuilder sb, String value) Applies themessagevalue to the log being built by the givenStringBuilder.protected abstract voidapplyThreadName(StringBuilder sb, String value) Applies thethreadNamevalue to the log being built by the givenStringBuilder.protected abstract voidapplyThrowableMessage(StringBuilder sb, String value) Applies thethrowableMessagevalue to the log being built by the givenStringBuilder.protected abstract voidapplyThrowableTraceLine(StringBuilder sb, String value) Applies thethrowableTraceLinevalue to the log being built by the givenStringBuilder.Methods inherited from class java.util.logging.Formatter
formatMessage, getHead, getTail
-
Constructor Details
-
GLogFormatter
protected GLogFormatter()Creates a base log formatter.
-
-
Method Details
-
format
- Overrides:
formatin classSimpleFormatter
-
applyDateTime
Applies thedatetimevalue to the log being built by the givenStringBuilder.- Parameters:
sb- Log message builder.value- Value to apply.
-
applyLevel
Applies thelevelvalue to the log being built by the givenStringBuilder.- Parameters:
sb- Log message builder.value- Value to apply.
-
applyThreadName
Applies thethreadNamevalue to the log being built by the givenStringBuilder.- Parameters:
sb- Log message builder.value- Value to apply.
-
applyClassName
Applies theclassNamevalue to the log being built by the givenStringBuilder.- Parameters:
sb- Log message builder.value- Value to apply.
-
applyMessage
Applies themessagevalue to the log being built by the givenStringBuilder.- Parameters:
sb- Log message builder.value- Value to apply.
-
applyThrowableMessage
Applies thethrowableMessagevalue to the log being built by the givenStringBuilder.- Parameters:
sb- Log message builder.value- Value to apply.
-
applyThrowableTraceLine
Applies thethrowableTraceLinevalue to the log being built by the givenStringBuilder.- Parameters:
sb- Log message builder.value- Value to apply.
-