com.sun.jdo.spi.persistence.utility.logging
Class LoggerJDK13

java.lang.Object
  extended by com.sun.jdo.spi.persistence.utility.logging.AbstractLogger
      extended by com.sun.jdo.spi.persistence.utility.logging.LoggerJDK13
All Implemented Interfaces:
Logger

public class LoggerJDK13
extends AbstractLogger

This class provides an implementation of the com.sun.jdo.spi.persistence.utility.Logger interface which subclasses the AbstractLogger and provides an implementation of its abstract methods which logs to a PrintStream (System.out). Note that this logger doesn't explicitly flush the PrintStream and depends on the JVM for flushing.

Version:
%I%
Author:
Rochelle Raccah

Field Summary
 
Fields inherited from interface com.sun.jdo.spi.persistence.utility.logging.Logger
ALL, CONFIG, FINE, FINER, FINEST, INFO, OFF, SEVERE, WARNING
 
Constructor Summary
LoggerJDK13(String loggerName, String bundleName, ClassLoader loader)
          Creates a new LoggerJDK13.
 
Method Summary
 void log(int level, String msg, Throwable thrown)
          Log a message.
protected  void logInternal(int level, String message)
          This method does the actual logging.
 
Methods inherited from class com.sun.jdo.spi.persistence.utility.logging.AbstractLogger
config, entering, entering, entering, exiting, exiting, fine, fine, fine, fine, fine, finer, finer, finer, finer, finer, finest, finest, finest, finest, finest, getBundle, getLevel, getMessage, getMessages, getMessageWithPrefix, getName, info, isLoggable, isLoggable, log, log, log, log, log, severe, throwing, toString, toString, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LoggerJDK13

public LoggerJDK13(String loggerName,
                   String bundleName,
                   ClassLoader loader)
Creates a new LoggerJDK13. The supplied class loader or the loader which loaded this class must be able to load the bundle.

Parameters:
loggerName - the full domain name of this logger
bundleName - the bundle name for message translation
loader - the loader used for looking up the bundle file and possibly the logging.properties or alternative file
Method Detail

log

public void log(int level,
                String msg,
                Throwable thrown)
Log a message.

If the logger is currently enabled for the message level then the given message, and the exception dump, is forwarded to all the registered output Handler objects.

Specified by:
log in interface Logger
Specified by:
log in class AbstractLogger
Parameters:
level - The level for this message
msg - The string message (or a key in the message catalog)
thrown - The exception to log

logInternal

protected void logInternal(int level,
                           String message)
This method does the actual logging. It is expected that if a check for isLoggable is desired for performance reasons, it has already been done, as it should not be done here. This implementation uses a print stream for logging.

Specified by:
logInternal in class AbstractLogger
Parameters:
level - the level to print
message - the message to print


Copyright © 2012 GlassFish Community. All Rights Reserved.