java.lang.Object
org.refcodes.logger.alt.io.IoLogger<T>
- Type Parameters:
T
- The type of theRecord
instances managed by theLogger
.
- All Implemented Interfaces:
org.refcodes.logger.LogDecorator
,org.refcodes.logger.Logger<T>
,org.refcodes.mixin.DelimiterAccessor
,org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<IoLogger<T>>
,org.refcodes.mixin.DelimiterAccessor.DelimiterMutator
,org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
,org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamMutator
,org.refcodes.mixin.PrintStreamAccessor.PrintStreamMutator
,org.refcodes.mixin.TrimAccessor
,org.refcodes.mixin.TrimAccessor.TrimBuilder<IoLogger<T>>
,org.refcodes.mixin.TrimAccessor.TrimMutator
,org.refcodes.mixin.TrimAccessor.TrimProperty
,org.refcodes.textual.CsvEscapeModeAccessor
,org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeBuilder<IoLogger<T>>
,org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeMutator
,org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeProperty
public class IoLogger<T>
extends Object
implements org.refcodes.logger.Logger<T>, org.refcodes.mixin.PrintStreamAccessor.PrintStreamMutator, org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamMutator, org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeProperty, org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeBuilder<IoLogger<T>>, org.refcodes.mixin.TrimAccessor.TrimProperty, org.refcodes.mixin.TrimAccessor.TrimBuilder<IoLogger<T>>, org.refcodes.mixin.DelimiterAccessor.DelimiterProperty, org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<IoLogger<T>>
The
IoLogger
implements the Logger
interface for providing
logging functionality for I/O output (e.g. via System.out
and
System.err
by default).-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.textual.CsvEscapeModeAccessor
org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeBuilder<B extends org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeBuilder<?>>, org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeMutator, org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.DelimiterAccessor
org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B extends org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B>>, org.refcodes.mixin.DelimiterAccessor.DelimiterMutator, org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.TrimAccessor
org.refcodes.mixin.TrimAccessor.TrimBuilder<B extends org.refcodes.mixin.TrimAccessor.TrimBuilder<B>>, org.refcodes.mixin.TrimAccessor.TrimMutator, org.refcodes.mixin.TrimAccessor.TrimProperty
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.refcodes.textual.CsvBuilder
protected PrintStream
protected org.refcodes.tabular.Header<T>
protected PrintStream
static final String
static final String
-
Constructor Summary
ConstructorDescriptionIoLogger()
Constructs aIoLogger
.Constructs aIoLogger
.Constructs aIoLogger
.IoLogger
(OutputStream aOutputStream) Constructs aIoLogger
.IoLogger
(OutputStream aOutputStream, OutputStream aErrorStream) Constructs aIoLogger
.IoLogger
(PrintStream aPrintStream) Constructs aIoLogger
.IoLogger
(PrintStream aOutputStream, PrintStream aErrorStream) Constructs aIoLogger
.Constructs aIoLogger
with the given header for logging.Constructs aIoLogger
with the given header for logging.Constructs aIoLogger
with the given header for logging.Constructs aIoLogger
with the given header for logging.Constructs aIoLogger
with the given header for logging.IoLogger
(org.refcodes.tabular.Header<T> aHeader, OutputStream aOutputStream) Constructs aIoLogger
with the given header for logging.IoLogger
(org.refcodes.tabular.Header<T> aHeader, OutputStream aOutputStream, char aCsvDelimiter) Constructs aIoLogger
with the given header for logging.IoLogger
(org.refcodes.tabular.Header<T> aHeader, OutputStream aOutputStream, OutputStream aErrorStream) Constructs aIoLogger
with the given header for logging.IoLogger
(org.refcodes.tabular.Header<T> aHeader, PrintStream aPrintStream) Constructs aIoLogger
with the given header for logging.IoLogger
(org.refcodes.tabular.Header<T> aHeader, PrintStream aPrintStream, char aCsvDelimiter) Constructs aIoLogger
with the given header for logging.IoLogger
(org.refcodes.tabular.Header<T> aHeader, PrintStream aOutputStream, PrintStream aErrorStream) Constructs aIoLogger
with the given header for logging.IoLogger
(org.refcodes.tabular.Header<T> aHeader, PrintStream aOutputStream, PrintStream aErrorStream, char aCsvDelimiter) Constructs aIoLogger
with the given header for logging. -
Method Summary
Modifier and TypeMethodDescriptionorg.refcodes.textual.CsvEscapeMode
char
protected org.refcodes.tabular.Header<T>
Returns theHeader
used by theIoLogger
for usage by sub-classes.boolean
isTrim()
void
void
setCsvEscapeMode
(org.refcodes.textual.CsvEscapeMode aCsvEscapeMode) void
setDelimiter
(char aDelimiter) void
setErrorPrintStream
(PrintStream aErrorStream) void
setPrintStream
(PrintStream aOutputStream) void
setTrim
(boolean isTrim) withCsvEscapeMode
(org.refcodes.textual.CsvEscapeMode aCsvEscapeMode) withDelimiter
(char aDelimiterChar) withTrim
(boolean isTrimRecords) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeProperty
letCsvEscapeMode
Methods inherited from interface org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
letDelimiter
Methods inherited from interface org.refcodes.logger.LogDecorator
printHead, printSeparator, printTail
Methods inherited from interface org.refcodes.mixin.TrimAccessor.TrimProperty
letTrim
-
Field Details
-
PROPERTY_ERROR_STREAM
- See Also:
-
PROPERTY_OUTPUT_STREAM
- See Also:
-
_header
-
_errorStream
-
_outputStream
-
_csvBuilder
protected org.refcodes.textual.CsvBuilder _csvBuilder
-
-
Constructor Details
-
IoLogger
Constructs aIoLogger
with the given header for logging.- Parameters:
aHeader
- The header used for logging in the correct format.aFile
- TheFile
to be used for printing.- Throws:
FileNotFoundException
- If the given file object does not denote an existing, writable regular file and a new regular file of that name cannot be created, or if some other error occurs while opening or creating the file.
-
IoLogger
public IoLogger(org.refcodes.tabular.Header<T> aHeader, File aFile, char aCsvDelimiter) throws FileNotFoundException Constructs aIoLogger
with the given header for logging.- Parameters:
aHeader
- The header used for logging in the correct format.aFile
- TheFile
to be used for printing.aCsvDelimiter
- The separator to be used when separating the CSV values in the log output.- Throws:
FileNotFoundException
- If the given file object does not denote an existing, writable regular file and a new regular file of that name cannot be created, or if some other error occurs while opening or creating the file.
-
IoLogger
Constructs aIoLogger
.- Parameters:
aInputFile
- TheFile
to be used for printing output.aErrorFile
- TheFile
to be used for printing errors.- Throws:
FileNotFoundException
- If the given file object does not denote an existing, writable regular file and a new regular file of that name cannot be created, or if some other error occurs while opening or creating the file.
-
IoLogger
public IoLogger(org.refcodes.tabular.Header<T> aHeader, File aInputFile, File aErrorFile) throws FileNotFoundException Constructs aIoLogger
with the given header for logging.- Parameters:
aHeader
- The header used for logging in the correct format.aInputFile
- TheFile
to be used for printing output.aErrorFile
- TheFile
to be used for printing errors.- Throws:
FileNotFoundException
- If the given file object does not denote an existing, writable regular file and a new regular file of that name cannot be created, or if some other error occurs while opening or creating the file.
-
IoLogger
Constructs aIoLogger
.- Parameters:
aFile
- TheFile
to be used for writing to.- Throws:
FileNotFoundException
- If the given file object does not denote an existing, writable regular file and a new regular file of that name cannot be created, or if some other error occurs while opening or creating the file.
-
IoLogger
Constructs aIoLogger
with the given header for logging.- Parameters:
aHeader
- The header used for logging in the correct format.aOutputStream
- TheOutputStream
to be used for printing.
-
IoLogger
public IoLogger(org.refcodes.tabular.Header<T> aHeader, OutputStream aOutputStream, char aCsvDelimiter) Constructs aIoLogger
with the given header for logging.- Parameters:
aHeader
- The header used for logging in the correct format.aOutputStream
- TheOutputStream
to be used for printing.aCsvDelimiter
- The separator to be used when separating the CSV values in the log output.
-
IoLogger
Constructs aIoLogger
.- Parameters:
aOutputStream
- TheOutputStream
to be used for printing output.aErrorStream
- TheOutputStream
to be used for printing errors.
-
IoLogger
public IoLogger(org.refcodes.tabular.Header<T> aHeader, OutputStream aOutputStream, OutputStream aErrorStream) Constructs aIoLogger
with the given header for logging.- Parameters:
aHeader
- The header used for logging in the correct format.aOutputStream
- TheOutputStream
to be used for printing output.aErrorStream
- TheOutputStream
to be used for printing errors.
-
IoLogger
Constructs aIoLogger
.- Parameters:
aOutputStream
- TheOutputStream
to be used for printing.
-
IoLogger
Constructs aIoLogger
.- Parameters:
aPrintStream
- ThePrintStream
to be used for printing.
-
IoLogger
Constructs aIoLogger
with the given header for logging.- Parameters:
aHeader
- The header used for logging in the correct format.aPrintStream
- ThePrintStream
to be used for printing.
-
IoLogger
public IoLogger(org.refcodes.tabular.Header<T> aHeader, PrintStream aPrintStream, char aCsvDelimiter) Constructs aIoLogger
with the given header for logging.- Parameters:
aHeader
- The header used for logging in the correct format.aPrintStream
- ThePrintStream
to be used for printing.aCsvDelimiter
- The separator to be used when separating the CSV values in the log output.
-
IoLogger
Constructs aIoLogger
.- Parameters:
aOutputStream
- ThePrintStream
to be used for printing output.aErrorStream
- ThePrintStream
to be used for printing errors.
-
IoLogger
public IoLogger(org.refcodes.tabular.Header<T> aHeader, PrintStream aOutputStream, PrintStream aErrorStream) Constructs aIoLogger
with the given header for logging.- Parameters:
aHeader
- The header used for logging in the correct format.aOutputStream
- ThePrintStream
to be used for printing output.aErrorStream
- ThePrintStream
to be used for printing errors.
-
IoLogger
public IoLogger(org.refcodes.tabular.Header<T> aHeader, PrintStream aOutputStream, PrintStream aErrorStream, char aCsvDelimiter) Constructs aIoLogger
with the given header for logging.- Parameters:
aHeader
- The header used for logging in the correct format.aOutputStream
- ThePrintStream
to be used for printing output.aErrorStream
- ThePrintStream
to be used for printing errors.aCsvDelimiter
- The separator to be used when separating the CSV values in the log output.
-
IoLogger
public IoLogger()Constructs aIoLogger
. -
IoLogger
Constructs aIoLogger
with the given header for logging.- Parameters:
aHeader
- The header used for logging in the correct format.
-
IoLogger
Constructs aIoLogger
with the given header for logging.- Parameters:
aHeader
- The header used for logging in the correct format.aCsvDelimiter
- The separator to be used when separating the CSV values in the log output.
-
-
Method Details
-
getCsvEscapeMode
public org.refcodes.textual.CsvEscapeMode getCsvEscapeMode()- Specified by:
getCsvEscapeMode
in interfaceorg.refcodes.textual.CsvEscapeModeAccessor
-
isTrim
public boolean isTrim()- Specified by:
isTrim
in interfaceorg.refcodes.mixin.TrimAccessor
-
getDelimiter
public char getDelimiter()- Specified by:
getDelimiter
in interfaceorg.refcodes.mixin.DelimiterAccessor
-
setTrim
public void setTrim(boolean isTrim) - Specified by:
setTrim
in interfaceorg.refcodes.mixin.TrimAccessor.TrimMutator
-
setDelimiter
public void setDelimiter(char aDelimiter) - Specified by:
setDelimiter
in interfaceorg.refcodes.mixin.DelimiterAccessor.DelimiterMutator
-
withTrim
- Specified by:
withTrim
in interfaceorg.refcodes.mixin.TrimAccessor.TrimBuilder<T>
-
withCsvEscapeMode
- Specified by:
withCsvEscapeMode
in interfaceorg.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeBuilder<T>
-
withDelimiter
- Specified by:
withDelimiter
in interfaceorg.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<T>
-
setCsvEscapeMode
public void setCsvEscapeMode(org.refcodes.textual.CsvEscapeMode aCsvEscapeMode) - Specified by:
setCsvEscapeMode
in interfaceorg.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeMutator
-
log
- Specified by:
log
in interfaceorg.refcodes.logger.Logger<T>
-
setErrorPrintStream
- Specified by:
setErrorPrintStream
in interfaceorg.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamMutator
-
setPrintStream
- Specified by:
setPrintStream
in interfaceorg.refcodes.mixin.PrintStreamAccessor.PrintStreamMutator
-
getHeader
Returns theHeader
used by theIoLogger
for usage by sub-classes.- Returns:
- The
Header
used by theIoLogger
.
-