com.bloomberglp.blpapi
Class Logging

java.lang.Object
  extended by com.bloomberglp.blpapi.Logging

public class Logging
extends java.lang.Object

Provides a way to register a call back for logging

The call back is provided as an interface that needs to be implemented. The method Logging.Callback.onMessage(long, Level, Datetime, String, String) 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.

 Logging.Callback cb = new Logging.Callback() {
      public void onMessage(
              long threadId,
              Level level,
              Datetime dateTime,
              String loggerName,
              String message) {
              // Do some processing
      }
  };
  Logging.registerCallback(cb, Level.WARNING);
 
 


Nested Class Summary
static interface Logging.Callback
          An interface for a callback that can been registered to get the log messages
 
Constructor Summary
Logging()
           
 
Method Summary
static void deregisterCallback()
          deregister the callback
static void logTestMessage(java.util.logging.Level level)
          log a test message at the specified 'level'.
static void registerCallback(Logging.Callback callback, java.util.logging.Level defaultThresholdlevel)
          register a callback with the specified 'level' as default threshold level
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Logging

public Logging()
Method Detail

registerCallback

public static void registerCallback(Logging.Callback callback,
                                    java.util.logging.Level defaultThresholdlevel)
register a callback with the specified 'level' as default threshold level


deregisterCallback

public static void deregisterCallback()
deregister the callback


logTestMessage

public static void logTestMessage(java.util.logging.Level level)
log a test message at the specified 'level'. Note that this function is intended for testing of the logging configuration only.



Copyright © 2015 Bloomberg L.P.. All Rights Reserved.