public class

FormattedLogMsg

extends Object
java.lang.Object
   ↳ com.atlassian.jira.startup.FormattedLogMsg

Class Overview

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.

Summary

Public Constructors
FormattedLogMsg()
Use this constructor if you dont intended to write to a Logger
FormattedLogMsg(Logger log)
Public Methods
void add(Object message, int indentLevel)
void add(Object message)
void addAll(Collection<String> collection)
void outputHeader(String header)
void outputProperty(String propertyDesc, String propertyValue)
void outputProperty(String propertyDesc, String propertyValue, String splitStr)
void outputProperty(String propertyDesc)
void outputProperty(String propertyDesc, String propertyValue, int indentLevel)
void outputProperty(String propertyDesc, String propertyValue, String splitStr, int indentLevel)
void printMessage(Level logLevel, boolean useStars)
Prints the contents of the current formatted messages to the Logger, using the specified LogLevel.
void printMessage(Level logLevel)
Prints the contents of the current formatted messages to the Logger, using the specified LogLevel.
String toString()
This will return the FormattedLogMsg as a String.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public FormattedLogMsg ()

Use this constructor if you dont intended to write to a Logger

public FormattedLogMsg (Logger log)

Public Methods

public void add (Object message, int indentLevel)

public void add (Object message)

public void addAll (Collection<String> collection)

public void outputHeader (String header)

public void outputProperty (String propertyDesc, String propertyValue)

public void outputProperty (String propertyDesc, String propertyValue, String splitStr)

public void outputProperty (String propertyDesc)

public void outputProperty (String propertyDesc, String propertyValue, int indentLevel)

public void outputProperty (String propertyDesc, String propertyValue, String splitStr, int indentLevel)

public void printMessage (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 as
useStars if true * characters will be placed around the message output

public void printMessage (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

public String 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

Returns
  • the the FormattedLogMsg as a String