# Class: 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](ILogger) instances returned by [#getLogger()](#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);
     ...
 }
 
```

## Constructor: GlobalLog


## Static Field: LEVEL_ALL
Type: `int`

Constant value: `0`

## Static Field: LEVEL_ALWAYS_ON
Type: `int`

Constant value: `60`

## Static Field: LEVEL_CATCHING
Type: `int`

Constant value: `60`
Description: Special level used to log exception related data such as stack traces. Messages above or equal to this level are never neutered. Eg, disabling a logger will not disable CATCHING messages to go through.

## Static Field: LEVEL_DEBUG
Type: `int`

Constant value: `20`

## Static Field: LEVEL_DISABLED
Type: `int`

Constant value: `2147483647`

## Static Field: LEVEL_ERROR
Type: `int`

Constant value: `50`

## Static Field: LEVEL_INFO
Type: `int`

Constant value: `30`

## Static Field: LEVEL_INTERNAL
Type: `int`

Constant value: `19`
Description: Reserved for internal use

## Static Field: LEVEL_NAMES
Type: `java.util.List<java.lang.String>`

## Static Field: LEVEL_STATUS
Type: `int`

Constant value: `100`
Description: special log level indicating a status message; logs with that status will not be directed to the regular sinks

## Static Field: LEVEL_TRACE
Type: `int`

Constant value: `10`

## Static Field: LEVEL_WARN
Type: `int`

Constant value: `40`

## Static Field: STANDARD_CUTOFF_LEVEL
Type: `int`

## Static Field: prefixWithLevel
Type: `boolean`

## Static Method: addDestinationBuffer
- parameter: `buffer`, type: `java.util.List<java.lang.CharSequence>`
- return type: `com.pnfsoftware.jeb.util.logging.BufferSink`

Description: 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\(\)
parameter: buffer: the thread\-safe buffer
return: the sink

## Static Method: addDestinationStream
- parameter: `out`, type: `java.io.OutputStream`
- return type: `com.pnfsoftware.jeb.util.logging.StreamSink`

Description: Add a destination stream to the list of log message recipients.
parameter: out: a destination stream
return: the sink

## Static Method: addGlobalFilter
- parameter: `pattern`, type: `java.lang.String`
- parameter: `requiredLevel`, type: `int`


## Static Method: addStatusSink
- parameter: `sink`, type: `com.pnfsoftware.jeb.util.logging.LogStatusSink`

Description: Register a status sink. Those sinks receive only logs having the special level [GlobalLog#LEVEL_STATUS](GlobalLog#LEVEL_STATUS).
parameter: sink: 

## Static Method: catching
- parameter: `logger`, type: `com.pnfsoftware.jeb.util.logging.ILogger`
- parameter: `t`, type: `java.lang.Throwable`


## Static Method: catching
- parameter: `logger`, type: `com.pnfsoftware.jeb.util.logging.ILogger`
- parameter: `t`, type: `java.lang.Throwable`
- parameter: `message`, type: `java.lang.String`


## Static Method: catchingDebug
- parameter: `logger`, type: `com.pnfsoftware.jeb.util.logging.ILogger`
- parameter: `t`, type: `java.lang.Throwable`


## Static Method: catchingDebug
- parameter: `logger`, type: `com.pnfsoftware.jeb.util.logging.ILogger`
- parameter: `t`, type: `java.lang.Throwable`
- parameter: `message`, type: `java.lang.String`


## Static Method: clearGlobalFilters


## Static Method: getCutoffLevel
- return type: `int`

Description: 
return: 

## Static Method: getDestinationBuffers
- return type: `java.util.List<com.pnfsoftware.jeb.util.logging.BufferSink>`

Description: Get the list of registered buffer sinks.
return: the list of buffer sinks

## Static Method: getDestinationStreams
- return type: `java.util.List<com.pnfsoftware.jeb.util.logging.StreamSink>`

Description: Get the list of registered stream sinks.
return: the list of stream sinks

## Static Method: getEnabledLevel
- return type: `int`

Description: Get the default logging level.
return: the default logging level

## Static Method: getInternalLogger
- parameter: `clazz`, type: `java.lang.Class<?>`
- return type: `com.pnfsoftware.jeb.util.logging.ILogger`

Description: Create or retrieve an internal logger. INTERNAL USAGE ONLY.
parameter: clazz: 
return: 

## Static Method: getLevelFromPrefixLetter
- parameter: `ch`, type: `char`
- return type: `int`

Description: Retrieve the log level associated to the provided prefix letter.
parameter: ch: prefix letter
return: log level matching the prefix character; negative value on error

## Static Method: getLogger
- return type: `com.pnfsoftware.jeb.util.logging.ILogger`

Description: Create or retrieve the anonymous logger. If created, the logging level is set to the default global logging level.
return: the anonymous logger

## Static Method: getLogger
- parameter: `clazz`, type: `java.lang.Class<?>`
- return type: `com.pnfsoftware.jeb.util.logging.ILogger`

Description: 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.
parameter: clazz: class reference
return: the logger

## Static Method: getLogger
- parameter: `clazz`, type: `java.lang.Class<?>`
- parameter: `level`, type: `int`
- return type: `com.pnfsoftware.jeb.util.logging.ILogger`

Description: Create or retrieve a logger attached to and named after a given class.
parameter: clazz: class reference
parameter: level: the cut\-off level
return: the logger

## Static Method: getLogger
- parameter: `name`, type: `java.lang.String`
- parameter: `level`, type: `int`
- return type: `com.pnfsoftware.jeb.util.logging.ILogger`

Description: Create or retrieve a named logger.
parameter: name: logger name
parameter: level: the cut\-off level
return: the logger

## Static Method: getPrefixLetterForLevel
- parameter: `level`, type: `int`
- return type: `char`

Description: Retrieve the prefix letter associated to the provided log level.
parameter: level: log level
return: a letter describing the level; 0 on failure

## Static Method: getRegularSinks
- return type: `java.util.List<com.pnfsoftware.jeb.util.logging.Sink<?>>`

Description: Get a list of the regular \(= non status\) sinks.
return: 

## Static Method: getStatusSinks
- return type: `java.util.List<com.pnfsoftware.jeb.util.logging.LogStatusSink>`

Description: 
return: the list of status sinks

## Static Method: isGloballyDisabled
- parameter: `logger`, type: `com.pnfsoftware.jeb.util.logging.ILogger`
- return type: `boolean`


## Static Method: levelToString
- parameter: `level`, type: `int`
- return type: `java.lang.String`


## Static Method: parseLevel
- parameter: `s`, type: `java.lang.String`
- return type: `int`

Description: Parse a log level name \(or number\) to a log level integer usable by Logger objects. On error, this method returns a negative value. Negative value are illegal log levels.
parameter: s: a log level name or integer as a string
return: integer log level, a negative value on error

## Static Method: removeDestinationBuffer
- parameter: `buffer`, type: `java.util.List<java.lang.CharSequence>`
- return type: `com.pnfsoftware.jeb.util.logging.BufferSink`

Description: Remove a destination buffer.
parameter: buffer: the destination buffer
return: the sink

## Static Method: removeDestinationStream
- parameter: `out`, type: `java.io.OutputStream`
- return type: `com.pnfsoftware.jeb.util.logging.StreamSink`

Description: Remove a destination stream.
parameter: out: the destination stream
return: the sink

## Static Method: removeGlobalFilter
- parameter: `pattern`, type: `java.lang.String`


## Static Method: removeStatusSink
- parameter: `sink`, type: `com.pnfsoftware.jeb.util.logging.LogStatusSink`

Description: Unregister a status sink.
parameter: sink: 

## Static Method: setCutoffLevel
- parameter: `cutoffLevel`, type: `int`
- return type: `int`

Description: 
parameter: cutoffLevel: new level
return: the previous level

## Static Method: setGlobalFilter
- parameter: `mute`, type: `boolean`


## Static Method: setLevelForNewLoggers
- parameter: `level`, type: `int`
- return type: `int`

Description: Set the default logging level
parameter: level: the default logging level
return: 

## Static Method: setLevelForNewLoggers
- parameter: `level`, type: `int`
- parameter: `updateExistingLoggers`, type: `boolean`
- return type: `int`

Description: 
parameter: level: 
parameter: updateExistingLoggers: 

## Static Method: status
- parameter: `format`, type: `java.lang.String`
- parameter: `params`, type: `java.lang.Object[]`

Description: Convenience method for `getLogger().status(...)`.
parameter: format: 
parameter: params: 

