Package de.mnl.osgi.lf4osgi
Class LoggerFactory
- java.lang.Object
-
- de.mnl.osgi.lf4osgi.LoggerFactory
-
public class LoggerFactory extends Object
The factory that supplies the OSGiLogger
s from static methods.
-
-
Constructor Summary
Constructors Constructor Description LoggerFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Logger
getLogger(Class<?> clazz)
Gets a logger, using the class name as name for the logger.static Logger
getLogger(String name)
Gets a logger with the given name.static Logger
getLogger(Bundle bundle, Class<?> clazz)
Gets a logger with the given class' name for the given bundle.static Logger
getLogger(Bundle bundle, String name)
Gets a logger with the given name for the given bundle.
-
-
-
Constructor Detail
-
LoggerFactory
public LoggerFactory()
-
-
Method Detail
-
getLogger
public static Logger getLogger(String name)
Gets a logger with the given name.- Parameters:
name
- the name- Returns:
- the logger
-
getLogger
public static Logger getLogger(Class<?> clazz)
Gets a logger, using the class name as name for the logger.- Parameters:
clazz
- the clazz- Returns:
- the logger
-
getLogger
public static Logger getLogger(Bundle bundle, String name)
Gets a logger with the given name for the given bundle.If the logging bundle happens to be known in the context in which
getLogger
is called, this method should be preferred overgetLogger(String)
because the latter implies a small overhead for finding out the calling bundle.- Parameters:
bundle
- the bundlename
- the name- Returns:
- the logger
-
getLogger
public static Logger getLogger(Bundle bundle, Class<?> clazz)
Gets a logger with the given class' name for the given bundle.If the logging bundle happens to be known in the context in which
getLogger
is called, this method should be preferred overgetLogger(Class)
because the latter implies a small overhead for finding out the calling bundle.- Parameters:
bundle
- the bundleclazz
- the class- Returns:
- the logger
-
-