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.25.11.64-experimental+d519cd77c15f00eb425bcde0dbe3273921f5910b
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 log severity level will not be reset and will remain unchanged.
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