FileDocCategorySizeDatePackage
LoggerJDK13.javaAPI DocGlassfish v2 API4252Fri May 04 22:35:24 BST 2007com.sun.jdo.spi.persistence.utility.logging

LoggerJDK13

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.
author
Rochelle Raccah
version
%I%

Fields Summary
private static final PrintStream
_printStream
Constructors Summary
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.

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


	                                                          	 
	      
		 
	
		super(loggerName, bundleName, loader);
	
Methods Summary
private static java.io.PrintStreamgetPrintStream()

 return _printStream; 
public synchronized voidlog(int level, java.lang.String msg, java.lang.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.

param
level The level for this message
param
msg The string message (or a key in the message catalog)
param
thrown The exception to log

		if (isLoggable(level))
		{
			logInternal(level, getMessage(msg));
			thrown.printStackTrace(getPrintStream());
		}
	
protected synchronized voidlogInternal(int level, java.lang.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.

param
level the level to print
param
message the message to print

		getPrintStream().println(getMessageWithPrefix(level, message));