public final class Library extends Object
When this class is run as a program, then it prints the name and version (if known) of this library to standard out.
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_LOCALE |
| Modifier and Type | Method and Description |
|---|---|
static String |
getLocale()
Get the current locale.
|
static LogBridge |
getLogBridge()
Get the current logging bridge.
|
static LogFilter |
getLogFilter()
Returns the active
LogFilter. |
static InputStream |
getMetaResourceAsStream(String path)
Retrieves a meta resource and returns it as an
InputStream. |
static String |
getName()
Returns the official human-readable name of this library.
|
static String |
getVersion()
Returns the version of this library.
|
static boolean |
isStackTraceAtMessageLevel()
Indicates whether the stack trace should be displayed at the same level as the message.
|
static void |
main(String[] args) |
static void |
resetLogBridge() |
static void |
setLocale(String newLocale)
Sets the locale for the complete Logdoc library.
|
static void |
setLogBridge(LogBridge logBridge)
Sets the logging bridge to be used.
|
static void |
setLogFilter(LogFilter logFilter)
Sets the current log filter.
|
static void |
setLogFilterByClassName(String className)
Set the active
LogFilter by class name. |
static void |
setStackTraceAtMessageLevel(boolean sameLevel)
Enables or disables the display of the stack trace at the same level as the message.
|
static void |
useDefaultLocale()
Sets the locale on all logdoc
Log classes to the default locale. |
public static final String DEFAULT_LOCALE
public static final void main(String[] args)
public static final String getName()
"Logdoc", never null.public static final String getVersion()
"3.0", or null if
unknown.public static void setLocale(String newLocale) throws UnsupportedLocaleException
newLocale - the new locale, cannot be null.UnsupportedLocaleException - if the specified locale is not supported by all registered Log
classes.public static void useDefaultLocale()
Log classes to the default locale.public static String getLocale()
"fr_FR"; never null.public static void resetLogBridge()
public static LogBridge getLogBridge()
null.public static void setLogBridge(LogBridge logBridge)
logBridge - the LogBridge to use, cannot be null.public static void setStackTraceAtMessageLevel(boolean sameLevel)
sameLevel - true if the stack trace should be at the same level, false
if the stack trace should be at LOG4J_DEBUG_LEVEL level.public static boolean isStackTraceAtMessageLevel()
true if the stack trace should be at the same level, false
if the stack trace should be at LOG4J_DEBUG_LEVEL level.public static void setLogFilter(LogFilter logFilter)
logFilter - the new LogFilter, cannot be null.public static void setLogFilterByClassName(String className) throws InstantiationException, IllegalAccessException, ClassNotFoundException
LogFilter by class name. If the parameter is null
then an exception is thrown. Otherwise if an instance cannot be constructed, then an instance
of class NullLogFilter is used instead.className - the name of the LogFilter class to use, cannot be null.InstantiationExceptionIllegalAccessExceptionClassNotFoundExceptionpublic static LogFilter getLogFilter()
LogFilter.LogFilter, never null.public static InputStream getMetaResourceAsStream(String path) throws NoSuchResourceException, IOException
InputStream. Calling this
function will not trigger initialization of the library.path - the path to the meta resource, cannot be null.InputStream.NoSuchResourceException - if the resource could not be found.IOException - if the stream could not be opened.Copyright © 2003-2013. All Rights Reserved.