com.google.gwt.core.ext
Class TreeLogger.NullLogger

java.lang.Object
  extended bycom.google.gwt.core.ext.TreeLogger.NullLogger
All Implemented Interfaces:
TreeLogger
Enclosing class:
TreeLogger

public static class TreeLogger.NullLogger
extends Object
implements TreeLogger


Nested Class Summary
 
Nested classes inherited from class com.google.gwt.core.ext.TreeLogger
TreeLogger.NullLogger, TreeLogger.Type
 
Field Summary
 
Fields inherited from class java.lang.Object
typeId, typeName
 
Fields inherited from interface com.google.gwt.core.ext.TreeLogger
ALL, DEBUG, ERROR, INFO, NULL, SPAM, TRACE, WARN
 
Method Summary
 TreeLogger branch(TreeLogger.Type type, String msg, Throwable caught)
          Produces a branched logger, which can be used to write messages that are logically grouped together underneath the current logger.
 boolean isLoggable(TreeLogger.Type type)
          Determines whether or not a log entry of the specified type would actually be logged.
 void log(TreeLogger.Type type, String msg, Throwable caught)
          Logs a message and/or an exception.
 
Methods inherited from class java.lang.Object
equals, finalize, hashCode, toString
 

Method Detail

branch

public TreeLogger branch(TreeLogger.Type type,
                         String msg,
                         Throwable caught)
Description copied from interface: TreeLogger
Produces a branched logger, which can be used to write messages that are logically grouped together underneath the current logger. The details of how/if the resulting messages are displayed is implementation-dependent.

The log message supplied when branching serves two purposes. First, the message should be considered a heading for all the child messages below it. Second, the type of the message provides a hint as to the importance of the children below it. As an optimization, an implementation could return a "no-op" logger if messages of the specified type weren't being logged, which the implication being that all nested log messages were no more important than the level of their branch parent.

As an example of how hierarchical logging can be used, a branched logger in a GUI could write log message as child items of a parent node in a tree control. If logging to streams, such as a text console, the branched logger could prefix each entry with a unique string and indent its text so that it could be sorted later to reconstruct a proper hierarchy.

Specified by:
branch in interface TreeLogger
Parameters:
type -
msg - An optional message to log, which can be null if only an exception is being logged
caught - An optional exception to log, which can be null if only a message is being logged
Returns:
an instance of TreeLogger representing the new branch of the log. May be the same instance on which this method is called

isLoggable

public boolean isLoggable(TreeLogger.Type type)
Description copied from interface: TreeLogger
Determines whether or not a log entry of the specified type would actually be logged. Caller use this method to avoid constructing log messages that would be thrown away.

Specified by:
isLoggable in interface TreeLogger

log

public void log(TreeLogger.Type type,
                String msg,
                Throwable caught)
Description copied from interface: TreeLogger
Logs a message and/or an exception. It is also legal to call this method using null arguments for both msg and caught, in which case the log event can be ignored.

Specified by:
log in interface TreeLogger
Parameters:
type -
msg - An optional message to log, which can be null if only an exception is being logged
caught - An optional exception to log, which can be null if only a message is being logged


This javadoc distribution was not produced by Google. The official documentation is here.