public final class MailLogger extends Object
Constructor and Description |
---|
MailLogger(Class<?> clazz,
String prefix,
boolean debug,
PrintStream out)
Construct a new MailLogger using the specified class' package
name as the Logger name,
debug prefix (e.g., "DEBUG"), debug flag, and PrintStream.
|
MailLogger(Class<?> clazz,
String prefix,
Session session)
Deprecated.
|
MailLogger(Class<?> clazz,
String subname,
String prefix,
boolean debug,
PrintStream out)
Construct a new MailLogger using the specified class' package
name combined with the specified subname as the Logger name,
debug prefix (e.g., "DEBUG"), debug flag, and PrintStream.
|
MailLogger(String name,
String prefix,
boolean debug,
PrintStream out)
Construct a new MailLogger using the specified Logger name,
debug prefix (e.g., "DEBUG"), debug flag, and PrintStream.
|
MailLogger(String name,
String prefix,
Session session)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
config(String msg)
Log a message at the CONFIG level.
|
void |
fine(String msg)
Log a message at the FINE level.
|
void |
finer(String msg)
Log a message at the FINER level.
|
void |
finest(String msg)
Log a message at the FINEST level.
|
MailLogger |
getLogger(Class<?> clazz,
String prefix)
Create a MailLogger using the specified class' package
name as the Logger name and the specified prefix.
|
MailLogger |
getLogger(String name,
String prefix)
Create a MailLogger that uses a Logger with the specified name
and prefix.
|
MailLogger |
getSubLogger(String subname,
String prefix)
Create a MailLogger that uses a Logger whose name is composed
of this MailLogger's name plus the specified sub-name, separated
by a dot.
|
MailLogger |
getSubLogger(String subname,
String prefix,
boolean debug)
Create a MailLogger that uses a Logger whose name is composed
of this MailLogger's name plus the specified sub-name, separated
by a dot.
|
boolean |
isLoggable(Level level)
If "debug" is set, or our embedded Logger is loggable at the
given level, return true.
|
void |
log(Level level,
String msg)
Log the message at the specified level.
|
void |
log(Level level,
String msg,
Object... params)
Log the message at the specified level.
|
void |
log(Level level,
String msg,
Object param1)
Log the message at the specified level.
|
void |
log(Level level,
String msg,
Throwable thrown)
Log the message at the specified level.
|
void |
logf(Level level,
String msg,
Object... params)
Log the message at the specified level using a format string.
|
public MailLogger(String name, String prefix, boolean debug, PrintStream out)
name
- the Logger nameprefix
- the prefix for debug output, or null for nonedebug
- if true, write to PrintStreamout
- the PrintStream to write topublic MailLogger(Class<?> clazz, String prefix, boolean debug, PrintStream out)
clazz
- the Logger name is the package name of this classprefix
- the prefix for debug output, or null for nonedebug
- if true, write to PrintStreamout
- the PrintStream to write topublic MailLogger(Class<?> clazz, String subname, String prefix, boolean debug, PrintStream out)
clazz
- the Logger name is the package name of this classsubname
- the Logger name relative to this Logger nameprefix
- the prefix for debug output, or null for nonedebug
- if true, write to PrintStreamout
- the PrintStream to write to@Deprecated public MailLogger(String name, String prefix, Session session)
name
- the Logger nameprefix
- the prefix for debug output, or null for nonesession
- where to get the debug flag and PrintStream@Deprecated public MailLogger(Class<?> clazz, String prefix, Session session)
clazz
- the Logger name is the package name of this classprefix
- the prefix for debug output, or null for nonesession
- where to get the debug flag and PrintStreampublic MailLogger getLogger(String name, String prefix)
name
- the Logger nameprefix
- the prefix for debug output, or null for nonepublic MailLogger getLogger(Class<?> clazz, String prefix)
clazz
- the Logger name is the package name of this classprefix
- the prefix for debug output, or null for nonepublic MailLogger getSubLogger(String subname, String prefix)
subname
- the Logger name relative to this Logger nameprefix
- the prefix for debug output, or null for nonepublic MailLogger getSubLogger(String subname, String prefix, boolean debug)
subname
- the Logger name relative to this Logger nameprefix
- the prefix for debug output, or null for nonedebug
- the debug flag for the sub-loggerpublic void log(Level level, String msg)
level
- the log level.msg
- the message.public void log(Level level, String msg, Object param1)
level
- the log level.msg
- the message.param1
- the additional parameter.public void log(Level level, String msg, Object... params)
level
- the log level.msg
- the message.params
- the message parameters.public void logf(Level level, String msg, Object... params)
level
- the log level.msg
- the message format string.params
- the message parameters.public void log(Level level, String msg, Throwable thrown)
level
- the log level.msg
- the message.thrown
- the throwable to log.public void config(String msg)
msg
- the message.public void fine(String msg)
msg
- the message.public void finer(String msg)
msg
- the message.public void finest(String msg)
msg
- the message.public boolean isLoggable(Level level)
level
- the log level.Copyright © 2019 JBoss by Red Hat. All rights reserved.