FileDocCategorySizeDatePackage
Logger.javaAPI DocGlassfish v2 API3754Fri May 04 22:34:10 BST 2007com.sun.enterprise.admin.util

Logger

public class Logger extends Object
Provides wrapper to direct logging messages to some kind of output.

Fields Summary
private static final int
LOG_BASE
public static final int
LOG_OFF
public static final int
LOG_ERRORS
public static final int
LOG_DEBUG
private static Logger
mInstance
protected static int
sLogLevel
Constructors Summary
Logger()

	
	
	
	
	
Methods Summary
protected void_log(java.lang.String msg)

		System.out.println( msg );
	
com.sun.enterprise.admin.util.LoggergetInstance()

		return( mInstance );
	
public static intgetLogLevel()

		return( sLogLevel );
	
public static voidlog(java.lang.String msg)
OK, but log( object ) preferred if it avoids generating a String from an object prior to the call.

		if ( sLogLevel >= LOG_DEBUG )
		{
			System.out.println( msg );
		}
	
public static voidlog(java.lang.Object object)
optimization for the caller; caller can pass an object directly so that if logging is off, we won't ever call toString()

		if ( sLogLevel >= LOG_DEBUG && object != null )
		{
			log( object.toString() );
		}
	
public static voidlogError(java.lang.String msg)

		if ( sLogLevel >= LOG_ERRORS && msg != null )
		{
			log( msg );
		}
	
public static voidlogFatal(java.lang.String msg)

		// always log
		log( msg );
	
public static intsetLogLevel(int logLevel)
set the log level; return the old log level

		int	oldLevel	= getLogLevel();
		
		Assert.assertit(	logLevel != LOG_OFF &&
						logLevel != LOG_ERRORS &&
						logLevel != LOG_DEBUG, "illegal log level" );
						
		sLogLevel	= logLevel;
			
		return( oldLevel );