|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Report
The Report
interface defines a reporting (logging, if you like)
interface for Schmant scripts.
The report accepts messages with different java.util.logging.Level
:s.
It decides if the message should be accepted based on the internal log level
(set with setLevel(Level)
). The initial report log level is based on
the verbosity level that Schmant was started with.
A script's default Report
instance is managed by the
ReportManager
. It uses a ReportFactory
to create the desired
Report
instance.
Report
instances are not thread safe. It is up to those creating
Schmant threads to give each thread its own Report
instance. (See the
ReportingThread
class.)
ReportManager
,
ReportFactory
Method Summary | |
---|---|
void |
close()
Close the current report. |
void |
debug(Object o)
Log a message to debug level ( Level.FINE ). |
void |
error(Object o)
Log a message to error level ( Level.SEVERE ). |
void |
error(Object o,
Throwable t)
Log a message and an exception to error level ( Level.SEVERE ). |
String |
getIdentifier()
Get the identifier for this report. |
Level |
getLevel()
Get the current log level. |
PrintWriter |
getStackTraceWriter(Level l)
Get a PrintWriter to write a stack trace to if the stack trace
for some reason cannot be logged through any of the ordinary logger
methods. |
void |
info(Object o)
Log a message to info level ( Level.INFO ). |
boolean |
isDebugReported()
Are messages to debug level ( Level.FINE ) logged? |
boolean |
isErrorReported()
Are messages to error level ( Level.SEVERE ) logged? |
boolean |
isInfoReported()
Are messages to info level ( Level.INFO ) logged? |
boolean |
isLevelReported(Level l)
Are messages to the supplied Level logged? |
boolean |
isTraceReported()
Are messages to trace level ( Level.FINER ) logged? |
boolean |
isWarnReported()
Are messages to warn level ( Level.WARNING ) logged? |
void |
log(Object o,
Level l)
Log a message to the supplied level. |
void |
log(Object o,
Throwable t,
Level l)
Log a message and an exception to the supplied level. |
void |
setLevel(Level l)
Set the log level. |
void |
trace(Object o)
Log a message to trace level ( Level.FINER ). |
void |
warn(Object o)
Log a message to warn level ( Level.WARNING ). |
void |
warn(Object o,
Throwable t)
Log a message and an exception to warn level ( Level.WARNING ). |
Method Detail |
---|
String getIdentifier()
null
.
null
.void trace(Object o)
Level.FINER
).
o
- The message to log.void debug(Object o)
Level.FINE
).
o
- The message to log.void info(Object o)
Level.INFO
).
o
- The message to log.void warn(Object o)
Level.WARNING
).
o
- The message to log.void warn(Object o, Throwable t)
Level.WARNING
).
o
- The message to log.t
- The exception to log.void error(Object o)
Level.SEVERE
).
o
- The message to log.void error(Object o, Throwable t)
Level.SEVERE
).
o
- The message to log.t
- The exception to log.void log(Object o, Level l)
o
- The message to log.l
- The level to log to.void log(Object o, Throwable t, Level l)
o
- The message to log. This may be null
.t
- The exception to log. This may be null
.l
- The level to log to.void setLevel(Level l)
l
- The log level.Level getLevel()
boolean isLevelReported(Level l)
Level
logged?
l
- The level.
true
if messages to the supplied level are logged.boolean isTraceReported()
Level.FINER
) logged?
true
if messages to trace level are logged.boolean isDebugReported()
Level.FINE
) logged?
true
if messages to debug level are logged.boolean isInfoReported()
Level.INFO
) logged?
true
if messages to info level are logged.boolean isWarnReported()
Level.WARNING
) logged?
true
if messages to warn level are logged.boolean isErrorReported()
Level.SEVERE
) logged?
true
if messages to error level are logged.PrintWriter getStackTraceWriter(Level l)
PrintWriter
to write a stack trace to if the stack trace
for some reason cannot be logged through any of the ordinary logger
methods.
The caller is responsible for closing the writer.
l
- The level to write the stack trace to.
void close()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |