| java.lang.Object | |
| ↳ | com.pnfsoftware.jeb.util.logging.GlobalLog |
Global logging facility used by JEB. This class offers methods to create per-class loggers. Upon initialization, a JEB client should add destination streams and buffers.
Implementation note: The official RCP client implementation provided with JEB registers stdout as well as the UI console window as destinations.
This class is thread-safe. However, ILogger instances returned by getLogger()
are not thread-safe.
How to use:
import com.pnfsoftware.jeb.util.logging.ILogger;
import com.pnfsoftware.jeb.util.loggingg.GlobalLog;
class Xyz {
private static final ILogger logger = GlobalLog.getLogger(Xyz.class);
...
}
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| int | LEVEL_ALL | ||||||||||
| int | LEVEL_CATCHING | ||||||||||
| int | LEVEL_DEBUG | ||||||||||
| int | LEVEL_DISABLED | ||||||||||
| int | LEVEL_ERROR | ||||||||||
| int | LEVEL_INFO | ||||||||||
| int | LEVEL_STATUS | ||||||||||
| int | LEVEL_TRACE | ||||||||||
| int | LEVEL_WARN | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| GlobalLog() | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| synchronized static void |
addDestinationBuffer(List<CharSequence> buffer)
Add a destination buffer to the list of log message recipients.
| ||||||||||
| synchronized static void |
addDestinationStream(PrintStream out)
Add a destination stream to the list of log message recipients.
| ||||||||||
| synchronized static void | addGlobalFilter(String pattern, int requiredLevel) | ||||||||||
| synchronized static void | addStatusSink(LogStatusSink sink) | ||||||||||
| static void | catching(ILogger logger, Throwable t) | ||||||||||
| static void | catchingDebug(ILogger logger, Throwable t) | ||||||||||
| synchronized static void | clearGlobalFilters() | ||||||||||
| synchronized static List<List<CharSequence>> |
getDestinationBuffers()
Get the list of destination buffers.
| ||||||||||
| synchronized static List<PrintStream> |
getDestinationStreams()
Get the list of destination streams.
| ||||||||||
| synchronized static int |
getEnabledLevel()
Get the default logging level.
| ||||||||||
| synchronized static ILogger |
getInternalLogger(Class<?> clazz)
Create or retrieve an internal logger.
| ||||||||||
| synchronized static ILogger |
getLogger(Class<?> clazz, int level)
Create or retrieve a logger attached to and named after a given class.
| ||||||||||
| synchronized static ILogger |
getLogger(Class<?> clazz)
Create or retrieve a logger attached to and named after a given class.
| ||||||||||
| synchronized static ILogger |
getLogger()
Create or retrieve the anonymous logger.
| ||||||||||
| synchronized static ILogger |
getLogger(String name, int level)
Create or retrieve a named logger.
| ||||||||||
| synchronized static List<LogStatusSink> | getStatusSinks() | ||||||||||
| synchronized static boolean | isGloballyDisabled(ILogger logger) | ||||||||||
| synchronized static void |
removeDestinationBuffer(List<CharSequence> buffer)
Remove a destination buffer.
| ||||||||||
| synchronized static void |
removeDestinationStream(PrintStream out)
Remove a destination stream.
| ||||||||||
| synchronized static void | removeGlobalFilter(String pattern) | ||||||||||
| synchronized static void | removeStatusSink(LogStatusSink sink) | ||||||||||
| synchronized static void | setEnabledLevel(int level, boolean updateExistingLoggers) | ||||||||||
| synchronized static void |
setEnabledLevel(int level)
Set the default logging level
| ||||||||||
| synchronized static void |
status(String format, Object... params)
Convenience method for
getLogger().status(...). | ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Add a destination buffer to the list of log message recipients. The list implementation must be thread-safe: it should be an object returned by Collections.synchronizedList()
| buffer | the thread-safe buffer |
|---|
Add a destination stream to the list of log message recipients.
| out | a destination stream |
|---|
Get the list of destination buffers.
Get the list of destination streams.
Get the default logging level.
Create or retrieve an internal logger. INTERNAL USAGE ONLY.
Create or retrieve a logger attached to and named after a given class.
| clazz | class reference |
|---|---|
| level | the cut-off level |
Create or retrieve a logger attached to and named after a given class. If created, the logging level is set to the default global logging level.
| clazz | class reference |
|---|
Create or retrieve the anonymous logger. If created, the logging level is set to the default global logging level.
Create or retrieve a named logger.
| name | logger name |
|---|---|
| level | the cut-off level |
Remove a destination buffer.
| buffer | the destination buffer |
|---|
Remove a destination stream.
| out | the destination stream |
|---|
Set the default logging level
| level | the default logging level |
|---|
Convenience method for getLogger().status(...).