Cytoscape 2.8.0 API

cytoscape.logger
Class CyLogger

java.lang.Object
  extended by cytoscape.logger.CyLogger

public class CyLogger
extends Object


Constructor Summary
protected CyLogger(String name)
          The constructor to create a CyLogger.
 
Method Summary
 void addLogHandler(CyLogHandler handler, LogLevel level)
          Add a new general log handler for all messages
 void addLogHandler(CyLogHandler handler, String loggerName, LogLevel level)
          Add a new log handler for specific messages
 void debug(String message)
          Log a debug message.
 void debug(String message, Throwable exception)
          Log a debug message.
 void error(String message)
          Log an error message.
 void error(String message, Throwable exception)
          Log an error exception message.
 void fatal(String message)
          Log a fatal error message.
 void fatal(String message, Throwable exception)
          Log a fatal exception message.
static CyLogger getLogger()
          Get the default ("cytoscape") logger
static CyLogger getLogger(Class logClass)
          Get a logger for the specified class
static CyLogger getLogger(String name)
          Get a logger with the specified name
 List<CyLogHandler> getLogHandlers(LogLevel level)
          Returns the current list of log handlers for the specified minimum level.
 List<CyLogHandler> getLogHandlers(String loggerName, LogLevel level)
          Returns the current list of log handlers for the specified logger at the suggested minimum level.
 void info(String message)
          Log an informational message.
 void info(String message, Throwable exception)
          Log an informational message.
 boolean isDebugging()
          Get the debug status.
 void log(String message, LogLevel level)
          Log a message at the specified log level.
 void log(String message, LogLevel level, Throwable t)
          Log a message at the specified log level.
 CyLogHandler removeLogHandler(CyLogHandler handler, LogLevel level)
          Remove a general log handler
 CyLogHandler removeLogHandler(CyLogHandler handler, String loggerName, LogLevel level)
          Remove a log handler for specific messages
 void setDebug(boolean debug)
          Set the debug status.
static void setDebugging(boolean on)
           
 void warn(String message)
          Log a warning message.
 void warn(String message, Throwable exception)
          Log a warning message.
 void warning(String message)
          Log a warning message.
 void warning(String message, Throwable exception)
          Log a warning message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CyLogger

protected CyLogger(String name)
The constructor to create a CyLogger. This should not be used, use getLogger instead.

Method Detail

getLogger

public static CyLogger getLogger(String name)
Get a logger with the specified name

Parameters:
name - the name of the logger
Returns:
the logger to use

getLogger

public static CyLogger getLogger(Class logClass)
Get a logger for the specified class

Parameters:
logClass - the class this logger logs for
Returns:
the logger to use

getLogger

public static CyLogger getLogger()
Get the default ("cytoscape") logger

Returns:
the logger to use

setDebugging

public static void setDebugging(boolean on)

debug

public void debug(String message)
Log a debug message.

Parameters:
message - the message to be logged

debug

public void debug(String message,
                  Throwable exception)
Log a debug message.

Parameters:
message - the message to be logged
exception - the exception to be logged

info

public void info(String message)
Log an informational message.

Parameters:
message - the message to be logged

info

public void info(String message,
                 Throwable exception)
Log an informational message.

Parameters:
message - the message to be logged
exception - the exception to be logged

warn

public void warn(String message)
Log a warning message.

Parameters:
message - the message to be logged

warn

public void warn(String message,
                 Throwable exception)
Log a warning message.

Parameters:
message - the message to be logged
exception - the exception to be logged

warning

public void warning(String message)
Log a warning message.

Parameters:
message - the message to be logged

warning

public void warning(String message,
                    Throwable exception)
Log a warning message.

Parameters:
message - the message to be logged
exception - the exception to be logged

error

public void error(String message)
Log an error message.

Parameters:
message - the message to be logged

error

public void error(String message,
                  Throwable exception)
Log an error exception message.

Parameters:
message - the message to be printed
exception - the exception to be logged

fatal

public void fatal(String message)
Log a fatal error message.

Parameters:
message - the message to be logged

fatal

public void fatal(String message,
                  Throwable exception)
Log a fatal exception message.

Parameters:
message - the message to be printed
exception - the exception to be logged

setDebug

public void setDebug(boolean debug)
Set the debug status. This will override the default debug setting from cytoscape.debug for this logger only.

Parameters:
debug - boolean setting for debugging state.

isDebugging

public boolean isDebugging()
Get the debug status.

Returns:
'true' if the debug flag is enabled.

log

public void log(String message,
                LogLevel level,
                Throwable t)
Log a message at the specified log level.

Parameters:
message - the message to be logged
level - the LogLevel to log the message at
t - a throwable to use to get a stack trace

log

public void log(String message,
                LogLevel level)
Log a message at the specified log level.

Parameters:
message - the message to be logged
level - the LogLevel to log the message at

addLogHandler

public void addLogHandler(CyLogHandler handler,
                          String loggerName,
                          LogLevel level)
Add a new log handler for specific messages

Parameters:
handler - the CyLogHandler that will handle the messages
loggerName - a String that indicates which messages this handler handles
level - the minimum LogLevel this handler is interested in

addLogHandler

public void addLogHandler(CyLogHandler handler,
                          LogLevel level)
Add a new general log handler for all messages

Parameters:
handler - the CyLogHandler that will handle the messages
level - the minimum LogLevel this handler is interested in

getLogHandlers

public List<CyLogHandler> getLogHandlers(String loggerName,
                                         LogLevel level)
Returns the current list of log handlers for the specified logger at the suggested minimum level.

Parameters:
loggerName - a String that indicates which messages the handlers handle
level - the minimum LogLevel the handlers are interested in
Returns:
a List of CyLogHandlers the meet the criteria

getLogHandlers

public List<CyLogHandler> getLogHandlers(LogLevel level)
Returns the current list of log handlers for the specified minimum level.

Parameters:
level - the minimum LogLevel the handlers are interested in
Returns:
a List of CyLogHandlers the meet the criteria

removeLogHandler

public CyLogHandler removeLogHandler(CyLogHandler handler,
                                     String loggerName,
                                     LogLevel level)
Remove a log handler for specific messages

Parameters:
handler - the CyLogHandler to remove
loggerName - a String that indicates which messages this handler handles
level - the minimum LogLevel this handler is interested in

removeLogHandler

public CyLogHandler removeLogHandler(CyLogHandler handler,
                                     LogLevel level)
Remove a general log handler

Parameters:
handler - the CyLogHandler to remove
level - the minimum LogLevel this handler is interested in

Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.