Logging Class |
Namespace: Bloomberglp.Blpapi
The Logging type exposes the following members.
Name | Description | |
---|---|---|
DeregisterCallback |
deregister a callback, the loglevel will not be reset and will continue to be the
the one that was last one.
| |
LogTestMessage |
Log a test message at the specified 'level'. Note that this function is intended
for testing of the logging configuration only.
| |
RegisterCallback |
register a callback with the specified 'thresholdLevel' as default threshold level
|
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 } }
var cb = new MyLogProcessor(); Logging.RegisterCallback(cb, TraceLevel.Warning);