andyLib v0.9.1

it.andynaz.log
Class LoggerMgr

java.lang.Object
  extended by it.andynaz.log.LoggerMgr

public class LoggerMgr
extends Object

This class let you create a "default" logger. The default logger is the one specified by tha value "log.defaultLogger" in the ConfigMgr class. The logger used should have two constructors, the one with no arguments and another one with takes a string.

The logger is created using the configuration stored in the ConfigMgr class. If the class specified by the value "defaultLogger" does not exist or it is not a subclass of Logger, a Logger is created (the one that uses the standard output).

Version:
2014/04/29
Author:
andynaz

Constructor Summary
private LoggerMgr()
           
 
Method Summary
static Logger getLogger()
          Returns a "default" logger without a name.
static Logger getLogger(String name)
          Returnes a "default" logger with a name.
private static Class<Logger> getLoggerClass()
          Returns the class used to create the logger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggerMgr

private LoggerMgr()
Method Detail

getLogger

public static Logger getLogger()
Returns a "default" logger without a name. The logger built has to have a contructor with no arguments.

Returns:
a default logger with no name, or a Logger in caso of errors

getLogger

public static Logger getLogger(String name)
Returnes a "default" logger with a name. The logger built has to have a contructor which takes a string (the logger's name).

Parameters:
name - the name of the logger
Returns:
a default logger (or a Logger in case of errors) with a name

getLoggerClass

private static Class<Logger> getLoggerClass()
Returns the class used to create the logger. The class name is taken from the "defaultLogger" property.

Returns:
the class used to create the logger

andyLib v0.9.1

© 2013 andynaz - http://andynaz.altervista.org