public final class NopLoggingProvider extends Object implements LoggingProvider
Constructor and Description |
---|
NopLoggingProvider() |
Modifier and Type | Method and Description |
---|---|
ContextProvider |
getContextProvider()
Returns the corresponding context provider.
|
Level |
getMinimumLevel()
Gets the lowest activated severity level for all tags.
|
Level |
getMinimumLevel(String tag)
Gets the lowest activated severity level for a tag.
|
boolean |
isEnabled(int depth,
String tag,
Level level)
Checks whether log entries with given tag and severity level will be output.
|
boolean |
isEnabled(String loggerClassName,
String tag,
Level level)
Checks whether log entries, issued by the caller of the given logger class, with given tag and severity level will be output.
|
void |
log(int depth,
String tag,
Level level,
Throwable exception,
MessageFormatter formatter,
Object obj,
Object... arguments)
Provides a regular log entry.
|
void |
log(String loggerClassName,
String tag,
Level level,
Throwable exception,
MessageFormatter formatter,
Object obj,
Object... arguments)
Provides a regular log entry.
|
void |
shutdown()
Shuts down the logging provider and frees all allocated resources.
|
public ContextProvider getContextProvider()
LoggingProvider
getContextProvider
in interface LoggingProvider
public Level getMinimumLevel()
LoggingProvider
The result of this method is cacheable and can be used to stop processing log entries at an early stage, before doing any expensive operations. All lower severity levels than the returned level will be never output. But it is not guaranteed the returned severity level or higher will be really output (for example if output depends on package or class name).
getMinimumLevel
in interface LoggingProvider
public Level getMinimumLevel(String tag)
LoggingProvider
The result of this method is cacheable and can be used to stop processing log entries at an early stage, before doing any expensive operations. All lower severity levels than the returned level will be never output. But it is not guaranteed the returned severity level or higher will be really output (for example if output depends on package or class name).
getMinimumLevel
in interface LoggingProvider
tag
- Tag to check (can be null
)public boolean isEnabled(int depth, String tag, Level level)
LoggingProvider
isEnabled
in interface LoggingProvider
depth
- Depth of caller in stack trace (e.g. '1' if there is only one method between caller and this method in
the stack trace)tag
- Tag to check (can be null
)level
- Severity level to checktrue
if given severity level is enabled, false
if disabledpublic boolean isEnabled(String loggerClassName, String tag, Level level)
LoggingProvider
isEnabled
in interface LoggingProvider
loggerClassName
- Fully-qualified class name of the logger instancetag
- Tag to check (can be null
)level
- Severity level to checktrue
if given severity level is enabled, false
if disabledpublic void log(int depth, String tag, Level level, Throwable exception, MessageFormatter formatter, Object obj, Object... arguments)
LoggingProvider
log
in interface LoggingProvider
depth
- Depth of caller in stack trace (e.g. '1' if there is only one method between caller and this method in
the stack trace)tag
- Tag of log entry or null
if untaggedlevel
- Severity level of log entryexception
- Exception to log or null
formatter
- Formatter for text message, only required if there are any arguments to insertobj
- Message to log or null
arguments
- Arguments for message or null
public void log(String loggerClassName, String tag, Level level, Throwable exception, MessageFormatter formatter, Object obj, Object... arguments)
LoggingProvider
log
in interface LoggingProvider
loggerClassName
- Fully-qualified class name of the logger instancetag
- Tag of log entry or null
if untaggedlevel
- Severity level of log entryexception
- Exception to log or null
formatter
- Formatter for text message, only required if there are any arguments to insertobj
- Message to log or null
arguments
- Arguments for message or null
public void shutdown()
LoggingProvider
shutdown
in interface LoggingProvider
Copyright © 2024. All rights reserved.