Package com.atlassian.jira.startup
Class FormattedLogMsg
java.lang.Object
com.atlassian.jira.startup.FormattedLogMsg
This class will allow a series of messages to be formated/indented into the one log4j ouput.
The idea is to build up a message and then call printMessage(), after which the contents of the message will be cleared and the formatter can be used again to output more messages.
- Since:
- v3.13
-
Constructor Summary
ConstructorsConstructorDescriptionUse this constructor if you dont intended to write to a LoggerFormattedLogMsg(org.apache.log4j.Logger log) FormattedLogMsg(org.apache.logging.log4j.Logger log) FormattedLogMsg(org.slf4j.Logger log) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidaddAll(Collection<String> collection) voidoutputHeader(String header) voidoutputProperty(String propertyDesc) voidoutputProperty(String propertyDesc, String propertyValue) voidoutputProperty(String propertyDesc, String propertyValue, int indentLevel) voidoutputProperty(String propertyDesc, String propertyValue, String splitStr) voidoutputProperty(String propertyDesc, String propertyValue, String splitStr, int indentLevel) voidprintMessage(org.apache.log4j.Level logLevel) voidprintMessage(org.apache.log4j.Level logLevel, boolean useStars) voidprintMessage(org.apache.logging.log4j.Level logLevel) Prints the contents of the current formatted messages to the Logger, using the specified LogLevel.voidprintMessage(org.apache.logging.log4j.Level logLevel, boolean useStars) Prints the contents of the current formatted messages to the Logger, using the specified LogLevel.voidprintMessage(org.slf4j.event.Level logLevel) voidprintMessage(org.slf4j.event.Level logLevel, boolean useStars) toString()This will return the FormattedLogMsg as a String.
-
Constructor Details
-
FormattedLogMsg
public FormattedLogMsg()Use this constructor if you dont intended to write to a Logger -
FormattedLogMsg
public FormattedLogMsg(org.apache.logging.log4j.Logger log) -
FormattedLogMsg
public FormattedLogMsg(org.apache.log4j.Logger log) -
FormattedLogMsg
public FormattedLogMsg(org.slf4j.Logger log)
-
-
Method Details
-
add
-
add
-
addAll
-
outputProperty
-
outputProperty
-
outputProperty
-
outputProperty
-
outputProperty
-
outputHeader
-
printMessage
public void printMessage(org.apache.logging.log4j.Level logLevel) Prints the contents of the current formatted messages to the Logger, using the specified LogLevel. * stars will be placed around the text in the log.The messages data will be cleared after this call, ready for new message output.
- Parameters:
logLevel- the log4j log level to output as
-
printMessage
public void printMessage(org.apache.log4j.Level logLevel) -
printMessage
public void printMessage(org.slf4j.event.Level logLevel) -
printMessage
public void printMessage(org.apache.logging.log4j.Level logLevel, boolean useStars) Prints the contents of the current formatted messages to the Logger, using the specified LogLevel. * stars will be placed around the text in the log if useStars is true.The messages data will be cleared after this call, ready for new output.
- Parameters:
logLevel- the log4j log level to output asuseStars- if true * characters will be placed around the message output
-
printMessage
public void printMessage(org.apache.log4j.Level logLevel, boolean useStars) -
printMessage
public void printMessage(org.slf4j.event.Level logLevel, boolean useStars) -
toString
This will return the FormattedLogMsg as a String. Calling this method does not reset the state of the log message in the way that printMessage() does
-