com.atomikos.diagnostics
Interface Console

All Known Implementing Classes:
CascadedConsole, PrintStreamConsole, RotatingFileConsole, Slf4jConsole

public interface Console

A message console for system output warnings. Warnings can have an optional level, which determines whether or not they will be actually shown (depending on the overall level set on the console).


Field Summary
static int DEBUG
          Constant to indicate debug-level messages.
static int INFO
          Constant to indicate informational-level messages.
static int WARN
          Constant to indicate warning-level messages.
 
Method Summary
 void close()
          Closes the console after use.
 int getLevel()
          Gets the level of the console.
 void print(String string)
          Print a string to the output, but no newline at the end.
 void print(String string, int level)
          Print a string with a given level of granularity.
 void println(String string)
          Print a message to the output of the console.
 void println(String string, int level)
          Print a string with newline, at a given level of granularity.
 void setLevel(int level)
          Set the overall granularity level of the console.
 

Field Detail

WARN

static final int WARN
Constant to indicate warning-level messages. This is the default level, and provides the lowest number of log data. Use this level to log coarse-grained information.

See Also:
Constant Field Values

INFO

static final int INFO
Constant to indicate informational-level messages. Informational messages only show if the level of the log is set to INFO or DEBUG.

See Also:
Constant Field Values

DEBUG

static final int DEBUG
Constant to indicate debug-level messages. This level can be used to provide info that only shows up if the console level is set to this degree.

See Also:
Constant Field Values
Method Detail

println

void println(String string)
             throws IOException
Print a message to the output of the console. The level is assumed to be the default (WARN).

Parameters:
string - The message to output.
Throws:
IOException - On failure.

print

void print(String string)
           throws IOException
Print a string to the output, but no newline at the end. The level is assumed to be the default (WARN).

Parameters:
string - The string to print.
Throws:
IOException - On failure.

println

void println(String string,
             int level)
             throws IOException
Print a string with newline, at a given level of granularity.

Parameters:
string - The string.
level - The level (one of the predefined constants).
Throws:
IOException - On failure.

print

void print(String string,
           int level)
           throws IOException
Print a string with a given level of granularity.

Parameters:
string - The string
level - The level (one of the predefined constants).
Throws:
IOException - On failure.

close

void close()
           throws IOException
Closes the console after use.

Throws:
IOException - On failure.

setLevel

void setLevel(int level)
Set the overall granularity level of the console. Messages printed with a higher level will be ignored.

Parameters:
level - The level, one of the predefined constants. Default is WARN.

getLevel

int getLevel()
Gets the level of the console.

Returns:
The log level.


Copyright © 2011. All Rights Reserved.