public abstract class AbstractTreeLogger extends TreeLogger
TreeLogger.HelpInfo, TreeLogger.Type
Modifier and Type | Field and Description |
---|---|
protected TreeLogger.Type |
logLevel |
protected AbstractTreeLogger |
parent |
Modifier | Constructor and Description |
---|---|
protected |
AbstractTreeLogger()
The constructor used when creating a top-level logger.
|
Modifier and Type | Method and Description |
---|---|
protected int |
allocateNextChildIndex() |
TreeLogger |
branch(TreeLogger.Type type,
String msg,
Throwable caught,
TreeLogger.HelpInfo helpInfo)
Implements branching behavior that supports lazy logging for low-priority
branched loggers.
|
protected void |
commitMyBranchEntryInMyParentLogger()
Commits the branch after ensuring that the parent logger (if there is one)
has been committed first.
|
protected abstract AbstractTreeLogger |
doBranch()
Derived classes should override this method to return a branched logger.
|
protected void |
doCommitBranch(AbstractTreeLogger childBeingCommitted,
TreeLogger.Type type,
String msg,
Throwable caught)
Deprecated.
This method has been deprecated; override
doCommitBranch(AbstractTreeLogger, com.google.gwt.core.ext.TreeLogger.Type, String, Throwable, com.google.gwt.core.ext.TreeLogger.HelpInfo)
instead. |
protected abstract void |
doCommitBranch(AbstractTreeLogger childBeingCommitted,
TreeLogger.Type type,
String msg,
Throwable caught,
TreeLogger.HelpInfo helpInfo)
Derived classes should override this method to actually commit the
specified message associated with this the root of this branch.
|
protected void |
doLog(int indexOfLogEntryWithinParentLogger,
TreeLogger.Type type,
String msg,
Throwable caught)
Deprecated.
This method has been deprecated; override
{@link #branch(com.google.gwt.core.ext.TreeLogger.Type, String, Throwable, com.google.gwt.core.ext.TreeLogger.HelpInfo)
instead.
|
protected abstract void |
doLog(int indexOfLogEntryWithinParentLogger,
TreeLogger.Type type,
String msg,
Throwable caught,
TreeLogger.HelpInfo helpInfo)
Derived classes should override this method to actually write a log
message.
|
int |
getBranchedIndex() |
protected static String |
getExceptionName(Throwable e) |
TreeLogger.Type |
getMaxDetail() |
AbstractTreeLogger |
getParentLogger() |
static String |
getStackTraceAsString(Throwable e) |
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,
TreeLogger.HelpInfo helpInfo)
Immediately logs or ignores the specified messages, based on the specified
message type and this logger's settings.
|
void |
setMaxDetail(TreeLogger.Type type) |
String |
toString() |
branch, branch, log, log
protected TreeLogger.Type logLevel
protected AbstractTreeLogger parent
protected AbstractTreeLogger()
public final TreeLogger branch(TreeLogger.Type type, String msg, Throwable caught, TreeLogger.HelpInfo helpInfo)
branch
in class TreeLogger
msg
- an optional message to log, which can be null
if
only an exception is being loggedcaught
- an optional exception to log, which can be null
if only a message is being loggedhelpInfo
- extra information that might be used by the logger to
provide extended information to the userTreeLogger
representing the new branch of
the log; may be the same instance on which this method is calledpublic final int getBranchedIndex()
public final TreeLogger.Type getMaxDetail()
public final AbstractTreeLogger getParentLogger()
public final boolean isLoggable(TreeLogger.Type type)
TreeLogger
isLoggable
in class TreeLogger
public final void log(TreeLogger.Type type, String msg, Throwable caught, TreeLogger.HelpInfo helpInfo)
log
in class TreeLogger
msg
- an optional message to log, which can be null
if
only an exception is being loggedcaught
- an optional exception to log, which can be null
if only a message is being loggedhelpInfo
- extra information that might be used by the logger to
provide extended information to the userpublic final void setMaxDetail(TreeLogger.Type type)
type
- the log type representing the most detailed level of logging
that the caller is interested in, or null
to choose
the default level.protected int allocateNextChildIndex()
protected void commitMyBranchEntryInMyParentLogger()
protected abstract AbstractTreeLogger doBranch()
@Deprecated protected final void doCommitBranch(AbstractTreeLogger childBeingCommitted, TreeLogger.Type type, String msg, Throwable caught)
doCommitBranch(AbstractTreeLogger, com.google.gwt.core.ext.TreeLogger.Type, String, Throwable, com.google.gwt.core.ext.TreeLogger.HelpInfo)
instead.childBeingCommitted
- type
- msg
- caught
- protected abstract void doCommitBranch(AbstractTreeLogger childBeingCommitted, TreeLogger.Type type, String msg, Throwable caught, TreeLogger.HelpInfo helpInfo)
@Deprecated protected final void doLog(int indexOfLogEntryWithinParentLogger, TreeLogger.Type type, String msg, Throwable caught)
indexOfLogEntryWithinParentLogger
- type
- msg
- caught
- protected abstract void doLog(int indexOfLogEntryWithinParentLogger, TreeLogger.Type type, String msg, Throwable caught, TreeLogger.HelpInfo helpInfo)
isLoggable(TreeLogger.Type)
will have already
been called.Copyright © 2018. All rights reserved.