Package com.storedobject.common
Interface LogWriter
- All Known Implementing Classes:
LogWriter.PrintWriterLogWriter
public interface LogWriter
Interface for custom log writers.
- Author:
- Syam
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classA LogWriter implementation that writes log messages to aPrintWriter. -
Method Summary
Modifier and TypeMethodDescriptionstatic LogWritercreate()Creates a new instance of a LogWriter that provides basic logging behavior using standard output streams.static LogWritercreate(PrintWriter writer) Creates a new instance of a LogWriter that wraps the givenPrintWriter.static LogWriterCreates a new instance of a LogWriter that wraps the provided Writer.static LogWriterCreates a new instance of a LogWriter that performs no operations.default voidWrites a debug message.default voidWrites an error message.default voidWrites an error with stack trace.default voidflush()Flushes any buffered output.
-
Method Details
-
debug
Writes a debug message.- Parameters:
message- the message to write
-
error
-
error
-
flush
default void flush()Flushes any buffered output. -
create
Creates a new instance of a LogWriter that provides basic logging behavior using standard output streams.- Returns:
- a LogWriter instance that writes debug messages to standard output and error messages to standard error.
-
create
Creates a new instance of a LogWriter that wraps the givenPrintWriter. The created LogWriter outputs log messages to the provided PrintWriter.- Parameters:
writer- the PrintWriter to which log messages will be written- Returns:
- a LogWriter instance that writes log messages using the given PrintWriter
-
create
Creates a new instance of a LogWriter that wraps the provided Writer. The created LogWriter outputs log messages to the given Writer.- Parameters:
writer- the Writer to which log messages will be written- Returns:
- a LogWriter instance that writes log messages using the provided Writer
-
createNull
Creates a new instance of a LogWriter that performs no operations. This implementation is a no-op and does not produce any output.- Returns:
- a LogWriter instance that discards all log messages and performs no actions
-