org.ow2.petals.microkernel.api.util
Class LoggingUtil

java.lang.Object
  extended by org.ow2.petals.microkernel.api.util.LoggingUtil
All Implemented Interfaces:
Logger

public class LoggingUtil
extends Object
implements Logger

Monolog logger implementation.

This class is used to format various logs. it can be used as a static class or as a wrapper object of a logger. The methods add to the resulting message a "ClassName-MethodName" information. (only for DEBUG and INFO level)

TODO : Rename to MonologLogger and move to kernel implementation

Author:
Adrien Louis - EBM WebSourcing

Field Summary
protected  Logger log
           
protected  String name
           
 
Constructor Summary
LoggingUtil(Logger logger)
          Creates a new instance of LoggingUtil
LoggingUtil(Logger logger, String loggerName)
          Creates a new instance of LoggingUtil
 
Method Summary
 void call()
          if log is enabled, Log as DEBUG : -CALL -
 void call(Object msg)
          if log is enabled, Log as DEBUG : -CALL -
 void debug(Object message)
          if log is enabled, Log as DEBUG the message
 void end()
          if log is enabled, Log as DEBUG : - END -
 void end(Object msg)
          if log is enabled, Log as DEBUG the message : - END -msg
 void error(Object message)
          if log is enabled, Log as ERROR the message
 void error(Object message, Throwable throwable)
          if log is enabled, Log as ERROR the exception
 Logger getLogger()
          Allow to return the logger implementation wrapped by LoggingUtil
 String getName()
          
 void info(Object message)
          if log is enabled, Log as INFO the message
 void info(Object message, Throwable error)
          if log is enabled, Log as INFO the message and error
 boolean isDebugEnabled()
          
 boolean isErrorEnabled()
          
 boolean isInfoEnabled()
          
 boolean isWarnEnabled()
          
 void start()
          if log is enabled, Log as DEBUG : -START-
 void start(Object msg)
          if log is enabled, Log as DEBUG the message : -START-msg
 void warning(Object message)
          if log is enabled, Log as warning the message
 void warning(Object message, Throwable throwable)
          if log is enabled, Log as warning the exception
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected Logger log

name

protected String name
Constructor Detail

LoggingUtil

public LoggingUtil(Logger logger)
Creates a new instance of LoggingUtil

Parameters:
logger -

LoggingUtil

public LoggingUtil(Logger logger,
                   String loggerName)
Creates a new instance of LoggingUtil

Parameters:
logger -
loggerName -
Method Detail

call

public void call()
if log is enabled, Log as DEBUG : -CALL -

Specified by:
call in interface Logger

call

public void call(Object msg)
if log is enabled, Log as DEBUG : -CALL -

Specified by:
call in interface Logger

start

public void start()
if log is enabled, Log as DEBUG : -START-

Specified by:
start in interface Logger

start

public void start(Object msg)
if log is enabled, Log as DEBUG the message : -START-msg

Specified by:
start in interface Logger

end

public void end()
if log is enabled, Log as DEBUG : - END -

Specified by:
end in interface Logger

end

public void end(Object msg)
if log is enabled, Log as DEBUG the message : - END -msg

Specified by:
end in interface Logger

debug

public void debug(Object message)
if log is enabled, Log as DEBUG the message

Specified by:
debug in interface Logger

info

public void info(Object message)
if log is enabled, Log as INFO the message

Specified by:
info in interface Logger

info

public void info(Object message,
                 Throwable error)
if log is enabled, Log as INFO the message and error

Specified by:
info in interface Logger

warning

public void warning(Object message)
if log is enabled, Log as warning the message

Specified by:
warning in interface Logger

warning

public void warning(Object message,
                    Throwable throwable)
if log is enabled, Log as warning the exception

Specified by:
warning in interface Logger

error

public void error(Object message)
if log is enabled, Log as ERROR the message

Specified by:
error in interface Logger

error

public void error(Object message,
                  Throwable throwable)
if log is enabled, Log as ERROR the exception

Specified by:
error in interface Logger

isDebugEnabled

public boolean isDebugEnabled()

Specified by:
isDebugEnabled in interface Logger
Returns:

isInfoEnabled

public boolean isInfoEnabled()

Specified by:
isInfoEnabled in interface Logger
Returns:

isWarnEnabled

public boolean isWarnEnabled()

Specified by:
isWarnEnabled in interface Logger
Returns:

isErrorEnabled

public boolean isErrorEnabled()

Specified by:
isErrorEnabled in interface Logger
Returns:

getName

public String getName()

Specified by:
getName in interface Logger

getLogger

public Logger getLogger()
Description copied from interface: Logger
Allow to return the logger implementation wrapped by LoggingUtil

Specified by:
getLogger in interface Logger
Returns:


Copyright © 2005-2015 Linagora. All Rights Reserved.