| Modifier and Type | Field and Description |
|---|---|
| private final boolean | debug
Produce debug output? |
| private final Logger | logger
For log messages. |
| private final PrintStream | out
Stream for debug output. |
| private final String | prefix
For debug output. |
| Access | Constructor and Description |
|---|---|
| public | MailLogger(String
the Logger name name, String the prefix for debug output, or null for none prefix, boolean if true, write to PrintStream debug, PrintStream the PrintStream to write to out)Construct a new MailLogger using the specified Logger name, debug prefix (e.g., "DEBUG"), debug flag, and PrintStream. |
| public | MailLogger(Class<?>
the Logger name is the package name of this class clazz, String the prefix for debug output, or null for none prefix, boolean if true, write to PrintStream debug, PrintStream the PrintStream to write to out)Construct a new MailLogger using the specified class' package name as the Logger name, debug prefix (e.g., "DEBUG"), debug flag, and PrintStream. |
| public | MailLogger(Class<?>
the Logger name is the package name of this class clazz, String the Logger name relative to this Logger name subname, String the prefix for debug output, or null for none prefix, boolean if true, write to PrintStream debug, PrintStream the PrintStream to write to 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. |
| public | MailLogger(String
the Logger name name, String the prefix for debug output, or null for none prefix, Session where to get the debug flag and PrintStream session)
Deprecated
Construct a new MailLogger using the specified Logger name and
debug prefix (e.g., "DEBUG").
|
| public | MailLogger(Class<?>
the Logger name is the package name of this class clazz, String the prefix for debug output, or null for none prefix, Session where to get the debug flag and PrintStream session)
Deprecated
Construct a new MailLogger using the specified class' package
name as the Logger name and the specified
debug prefix (e.g., "DEBUG").
|
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private void | |
| public void | |
| public void | |
| public void | |
| public MailLogger | |
| public MailLogger | |
| public MailLogger | Returns: a MailLogger for the given name and prefix.the Logger name relative to this Logger name subname, String the prefix for debug output, or null for none 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. |
| public MailLogger | Returns: a MailLogger for the given name and prefix.the Logger name relative to this Logger name subname, String the prefix for debug output, or null for none prefix, boolean the debug flag for the sub-logger 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. |
| private void | |
| private StackTraceElement | Returns: StackTraceElement that logged the message. Treat as read-only.A disadvantage of not being able to use Logger directly in JavaMail code is that the "source class" information that Logger guesses will always refer to this class instead of our caller. |
| public boolean | Returns: true if loggable.the log level. level)If "debug" is set, or our embedded Logger is loggable at the given level, return true. |
| private boolean | Returns: true if the class name is part of the MailLogger bridge.the class name. cname)Frames to ignore as part of the MailLogger to JUL bridge. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| private String |
| debug | back to summary |
|---|---|
| private final boolean debug Produce debug output? | |
| logger | back to summary |
|---|---|
| private final Logger logger For log messages. | |
| out | back to summary |
|---|---|
| private final PrintStream out Stream for debug output. | |
| prefix | back to summary |
|---|---|
| private final String prefix For debug output. | |
| MailLogger | back to summary |
|---|---|
| public 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 | back to summary |
|---|---|
| public 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 | back to summary |
|---|---|
| public 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 | back to summary |
|---|---|
| public MailLogger(String name, String prefix, Session session)
Deprecated
Construct a new MailLogger using the specified Logger name and debug prefix (e.g., "DEBUG"). Get the debug flag and PrintStream from the Session.
| |
| MailLogger | back to summary |
|---|---|
| public MailLogger(Class<?> clazz, String prefix, Session session)
Deprecated
Construct a new MailLogger using the specified class' package name as the Logger name and the specified debug prefix (e.g., "DEBUG"). Get the debug flag and PrintStream from the Session.
| |
| config | back to summary |
|---|---|
| public void config(String msg) Log a message at the CONFIG level.
| |
| debugOut | back to summary |
|---|---|
| private void debugOut(String msg) Common formatting for debug output.
| |
| fine | back to summary |
|---|---|
| public void fine(String msg) Log a message at the FINE level.
| |
| finer | back to summary |
|---|---|
| public void finer(String msg) Log a message at the FINER level.
| |
| finest | back to summary |
|---|---|
| public void finest(String msg) Log a message at the FINEST level.
| |
| getLogger | back to summary |
|---|---|
| public MailLogger getLogger(String name, String prefix) Create a MailLogger that uses a Logger with the specified name and prefix. The new MailLogger uses the same debug flag and PrintStream as this MailLogger.
| |
| getLogger | back to summary |
|---|---|
| public MailLogger getLogger(Class<?> clazz, String prefix) Create a MailLogger using the specified class' package name as the Logger name and the specified prefix. The new MailLogger uses the same debug flag and PrintStream as this MailLogger.
| |
| getSubLogger | back to summary |
|---|---|
| public 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. The new MailLogger uses the new prefix for debug output. This is used primarily by the protocol trace code that wants a different prefix (none).
| |
| getSubLogger | back to summary |
|---|---|
| public 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. The new MailLogger uses the new prefix for debug output. This is used primarily by the protocol trace code that wants a different prefix (none).
| |
| ifDebugOut | back to summary |
|---|---|
| private void ifDebugOut(String msg) Common code to conditionally log debug statements.
| |
| inferCaller | back to summary |
|---|---|
| private StackTraceElement inferCaller() A disadvantage of not being able to use Logger directly in JavaMail code is that the "source class" information that Logger guesses will always refer to this class instead of our caller. This method duplicates what Logger does to try to find *our* caller, so that Logger doesn't have to do it (and get the wrong answer), and because our caller is what's wanted.
| |
| isLoggable | back to summary |
|---|---|
| public boolean isLoggable(Level level) If "debug" is set, or our embedded Logger is loggable at the given level, return true.
| |
| isLoggerImplFrame | back to summary |
|---|---|
| private boolean isLoggerImplFrame(String cname) Frames to ignore as part of the MailLogger to JUL bridge.
| |
| log | back to summary |
|---|---|
| public void log(Level level, String msg) Log the message at the specified level. | |
| log | back to summary |
|---|---|
| public void log(Level level, String msg, Object param1) Log the message at the specified level. | |
| log | back to summary |
|---|---|
| public void log(Level level, String msg, Object... params) Log the message at the specified level. | |
| log | back to summary |
|---|---|
| public void log(Level level, String msg, Throwable thrown) Log the message at the specified level. | |
| logf | back to summary |
|---|---|
| public void logf(Level level, String msg, Object... params) Log the message at the specified level using a format string. | |
| packageOf | back to summary |
|---|---|
| private String packageOf(Class<?> clazz) Return the package name of the class. Sometimes there will be no Package object for the class, e.g., if the class loader hasn't created one (see Class.getPackage()). | |