Package org.slf4j
Class MarkerFactory
- java.lang.Object
-
- org.slf4j.MarkerFactory
-
public class MarkerFactory extends java.lang.Object
MarkerFactory is a utility class producingMarker
instances as appropriate for the logging system currently in use.This class is essentially implemented as a wrapper around an
IMarkerFactory
instance bound at compile time.Please note that all methods in this class are static.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static IMarkerFactory
MARKER_FACTORY
-
Constructor Summary
Constructors Modifier Constructor Description private
MarkerFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static IMarkerFactory
bwCompatibleGetMarkerFactoryFromBinder()
As of SLF4J version 1.7.14, StaticMarkerBinder classes shipping in various bindings come with a getSingleton() method.static Marker
getDetachedMarker(java.lang.String name)
Create a marker which is detached (even at birth) from the MarkerFactory.static IMarkerFactory
getIMarkerFactory()
Return theIMarkerFactory
instance in use.static Marker
getMarker(java.lang.String name)
Return a Marker instance as specified by the name parameter using the previously boundIMarkerFactory
instance.
-
-
-
Field Detail
-
MARKER_FACTORY
static IMarkerFactory MARKER_FACTORY
-
-
Method Detail
-
bwCompatibleGetMarkerFactoryFromBinder
private static IMarkerFactory bwCompatibleGetMarkerFactoryFromBinder() throws java.lang.NoClassDefFoundError
As of SLF4J version 1.7.14, StaticMarkerBinder classes shipping in various bindings come with a getSingleton() method. Previously only a public field called SINGLETON was available.- Returns:
- IMarkerFactory
- Throws:
java.lang.NoClassDefFoundError
- in case no binding is available- Since:
- 1.7.14
-
getMarker
public static Marker getMarker(java.lang.String name)
Return a Marker instance as specified by the name parameter using the previously boundIMarkerFactory
instance.- Parameters:
name
- The name of theMarker
object to return.- Returns:
- marker
-
getDetachedMarker
public static Marker getDetachedMarker(java.lang.String name)
Create a marker which is detached (even at birth) from the MarkerFactory.- Parameters:
name
- the name of the marker- Returns:
- a dangling marker
- Since:
- 1.5.1
-
getIMarkerFactory
public static IMarkerFactory getIMarkerFactory()
Return theIMarkerFactory
instance in use.The IMarkerFactory instance is usually bound with this class at compile time.
- Returns:
- the IMarkerFactory instance in use
-
-