public class FailureOnlyMessageLogger extends Object implements StatefulMessageLogger
close(boolean, boolean)
is called with successful==true
.
The text cannot be written immediately, so is saved until close(boolean, boolean)
is called.
Constructor and Description |
---|
FailureOnlyMessageLogger(String outputName,
OutputterChecked outputter,
ErrorReporter errorReporter,
boolean considerWarningAsFailure) |
Modifier and Type | Method and Description |
---|---|
void |
close(boolean successful,
boolean warningOccurred)
Stops logging.
|
void |
log(String message)
Logs a message.
|
void |
logFormatted(String formatString,
Object... args)
Logs a message, derived from a format-string.
|
void |
start()
Starts logging.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
logEmptyLine
public FailureOnlyMessageLogger(String outputName, OutputterChecked outputter, ErrorReporter errorReporter, boolean considerWarningAsFailure)
public void log(String message)
MessageLogger
log
in interface MessageLogger
message
- the message to log.public void logFormatted(String formatString, Object... args)
MessageLogger
logFormatted
in interface MessageLogger
formatString
- a format string like in String.format(java.lang.String, java.lang.Object...)
.args
- the arguments that match the placeholder in formatString
like in String.format(java.lang.String, java.lang.Object...)
.public void start()
StatefulMessageLogger
This must be called once before any logging occurs.
start
in interface StatefulMessageLogger
public void close(boolean successful, boolean warningOccurred)
StatefulMessageLogger
This must be called once after all logging has occurred.
close
in interface StatefulMessageLogger
successful
- true when the task completed successfully.warningOccurred
- true if at least one warning has occurred, false otherwise.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.