org.gcube.common.core.utils.logging
Class GCUBELog

java.lang.Object
  extended by org.gcube.common.core.utils.logging.GCUBELog
Direct Known Subclasses:
GCUBEClientLog

public class GCUBELog
extends Object

A wrapper of logger implementations built on top of org.apache.commons.logging interfaces and configuration. It can be configured to prepend a given string to all messagges, where the prefix is either explicitly provided or is extracted from a GCUBEContext.

Author:
Manuele Simi (CNR),Fabio Simeoni (University of Strathclyde)

Constructor Summary
GCUBELog(Object obj)
          Creates a new logger for a given object.
GCUBELog(Object obj, GCUBEContext context)
          Creates a new logger for a given object and in a given context.
GCUBELog(Object obj, String prefix)
          Creates a new logger for a given object and with a given prefix to prepend to all log messages.
 
Method Summary
 void debug(Object arg0)
           
 void debug(Object arg0, Throwable arg1)
           
 void error(Object arg0)
           
 void error(Object arg0, Throwable arg1)
           
 void fatal(Object arg0)
           
 void fatal(Object arg0, Throwable arg1)
           
 String getPrefix()
          Returns the log prefix.
 void info(Object arg0)
           
 void info(Object arg0, Throwable arg1)
           
 boolean isDebugEnabled()
           
 boolean isErrorEnabled()
           
 boolean isFatalEnabled()
           
 boolean isInfoEnabled()
           
 boolean isTraceEnabled()
           
 boolean isWarnEnabled()
           
 void setContext(GCUBEContext context)
          Sets the logging context.
 void setPrefix(String prefix)
          Sets the log prefix.
 void trace(Object arg0)
           
 void trace(Object arg0, Throwable arg1)
           
 void warn(Object arg0)
           
 void warn(Object arg0, Throwable arg1)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GCUBELog

public GCUBELog(Object obj,
                GCUBEContext context)
Creates a new logger for a given object and in a given context. It prepends the name of the context to all log messages.

Parameters:
obj - the object.
context - the service context.

GCUBELog

public GCUBELog(Object obj,
                String prefix)
Creates a new logger for a given object and with a given prefix to prepend to all log messages.

Parameters:
obj - the object.
prefix - the prefix..

GCUBELog

public GCUBELog(Object obj)
Creates a new logger for a given object.

Parameters:
obj - the object.
Method Detail

debug

public void debug(Object arg0)
See Also:
Log.debug(Object)

debug

public void debug(Object arg0,
                  Throwable arg1)
See Also:
Log.debug(Object, Throwable)

error

public void error(Object arg0)
See Also:
Log.error(Object)

error

public void error(Object arg0,
                  Throwable arg1)
See Also:
Log.error(Object,Throwable)

fatal

public void fatal(Object arg0)
See Also:
Log.fatal(Object)

fatal

public void fatal(Object arg0,
                  Throwable arg1)
See Also:
Log.fatal(Object,Throwable)

info

public void info(Object arg0)
See Also:
Log.info(Object)

info

public void info(Object arg0,
                 Throwable arg1)
See Also:
Log.fatal(Object, Throwable)

trace

public void trace(Object arg0)
See Also:
Log.trace(Object)

trace

public void trace(Object arg0,
                  Throwable arg1)
See Also:
Log.fatal(Object, Throwable)

warn

public void warn(Object arg0)
See Also:
Log.warn(Object)

warn

public void warn(Object arg0,
                 Throwable arg1)
See Also:
Log.warn(Object, Throwable)

isDebugEnabled

public boolean isDebugEnabled()
See Also:
Log.isDebugEnabled()

isErrorEnabled

public boolean isErrorEnabled()
See Also:
Log.isErrorEnabled()

isFatalEnabled

public boolean isFatalEnabled()
See Also:
Log.isFatalEnabled()

isInfoEnabled

public boolean isInfoEnabled()
See Also:
Log.isInfoEnabled()

isTraceEnabled

public boolean isTraceEnabled()
See Also:
Log.isTraceEnabled()

isWarnEnabled

public boolean isWarnEnabled()
See Also:
Log.isWarnEnabled()

getPrefix

public String getPrefix()
Returns the log prefix.

Returns:
the prefix.

setPrefix

public void setPrefix(String prefix)
Sets the log prefix.

Parameters:
prefix - the prefix.

setContext

public void setContext(GCUBEContext context)
Sets the logging context.

Parameters:
context - the context.


Copyright © 2012. All Rights Reserved.