org.apache.wink.logging
Class WinkLogHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by org.apache.wink.logging.WinkLogHandler

public class WinkLogHandler
extends Handler


Nested Class Summary
static class WinkLogHandler.LEVEL
           
 
Constructor Summary
WinkLogHandler()
           
 
Method Summary
static void clearRecords()
          Clear all logRecords from the captured list.
 void close()
           
 void flush()
           
static Level getLogLevel()
           
static List<LogRecord> getRecords()
          get all captured LogRecords.
static List<LogRecord> getRecordsFilteredBy(String logName)
          Get only the records associated with the logger for a particular name.
 void publish(LogRecord record)
           
static void turnLoggingCaptureOff()
          turns logging capture off
static void turnLoggingCaptureOn(WinkLogHandler.LEVEL _level)
          turns logging capture on
 
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WinkLogHandler

public WinkLogHandler()
Method Detail

close

public void close()
           throws SecurityException
Specified by:
close in class Handler
Throws:
SecurityException

flush

public void flush()
Specified by:
flush in class Handler

getLogLevel

public static Level getLogLevel()

publish

public void publish(LogRecord record)
Specified by:
publish in class Handler

turnLoggingCaptureOn

public static void turnLoggingCaptureOn(WinkLogHandler.LEVEL _level)
turns logging capture on


turnLoggingCaptureOff

public static void turnLoggingCaptureOff()
turns logging capture off


getRecords

public static List<LogRecord> getRecords()
get all captured LogRecords. It is recommended that you inspect the returned list, perform the desired asserts, then call clearRecords to clean up the list prior to the next test that may wish to also capture logging.

Returns:
ArrayList of LogRecords captured

getRecordsFilteredBy

public static List<LogRecord> getRecordsFilteredBy(String logName)
Get only the records associated with the logger for a particular name. Typically, this will be the class name of the production class under test.

Parameters:
logName -
Returns:
filtered ArrayList of LogRecords captured

clearRecords

public static void clearRecords()
Clear all logRecords from the captured list. It is recommended that test methods do this to clean up prior to the next test that may wish to also capture logging.



Copyright © 2009-2012 The Apache Software Foundation. All Rights Reserved.