Click or drag to resize
Logging Class
Provides a way to register a call back for logging
Inheritance Hierarchy
SystemObject
  Bloomberglp.BlpapiLogging

Namespace:  Bloomberglp.Blpapi
Assembly:  Bloomberglp.Blpapi (in Bloomberglp.Blpapi.dll) Version: 3.24.7.1
Syntax
public sealed class Logging

The Logging type exposes the following members.

Constructors
  NameDescription
Public methodLogging
Initializes a new instance of the Logging class
Top
Methods
  NameDescription
Public methodStatic memberDeregisterCallback
deregister a callback, the loglevel will not be reset and will continue to be the the one that was last one.
Public methodStatic memberLogTestMessage
Log a test message at the specified 'level'. Note that this function is intended for testing of the logging configuration only.
Public methodStatic memberRegisterCallback
register a callback with the specified 'thresholdLevel' as default threshold level
Top
Remarks

The call back is provided as an interface that needs to be implemented. The method onMessage() is called when a message that needs logging is available. Callback is only called for messages that have 'level' higher than or equal to the 'defaultThresholdLevel'. There can be only one callback that can be registered and if another callback is registered it will replace the previous one.

Usage example:
public class MyLogProcessor : Logging.Callback
{
    public void OnMessage(
        long threadId, TraceLevel level,
        Datetime dateTime, string loggerName, string message)
    {
        // Do some processing
    }
}
This callback needs to be registered with the library as:
var cb = new MyLogProcessor();
Logging.RegisterCallback(cb, TraceLevel.Warning);
See Also