IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.
|
Reporters that utilize logging messages to files. IReporterTextLogger typically outputs (to a file) messages in one-line format with possibility to define indentation, while IReporterTextWriter typically outputs multi-line messages formatted for increased visibility. More...
Public Member Functions | |
bool | SetTextLogger (TextWriter writer) |
Sets the text writer to which reporting is also performed. | |
bool | SetTextLogger (TextWriter writer, bool writeintro) |
Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument. | |
bool | SetTextLogger (TextWriter writer, bool writeintro, bool disposewriter) |
Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument. | |
bool | SetTextLogger (Stream stream) |
Creates a TextLogger upon the stream and sets it as the text writer to which reporting is also performed. | |
bool | SetTextLogger (Stream stream, bool writeintro) |
Creates a TextLogger upon the stream and sets it as the basic TextLogger to which reporting is performed. Overrides the writeintro property by the 'writeintro' argument. | |
bool | SetTextLogger (Stream stream, bool writeintro, bool disposewriter) |
Creates a TextLogger upon the stream and sets it as the basic TextLogger to which reporting is performed. Overrides the writeintro property by the 'writeintro' argument. | |
bool | SetTextLogger (string filename) |
Creates a TextLogger upon a file and sets it as the basic TextLogger to which reporting is also performed. The file is overwritten. | |
bool | SetTextLogger (string filename, bool append) |
Creates a TextLogger upon a file and sets it as the basic TextLogger to which reporting is also performed, where the caller specifies either to overwrite the file or to append to it. | |
bool | SetTextLogger (string filename, bool append, bool writeintro) |
Creates a TextLogger upon a file and sets it as the text writer to which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins. | |
bool | SetTextLogger (string filename, bool append, bool writeintro, bool disposewriter) |
Creates a TextLogger upon a file and sets it as the text writer to which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins. | |
bool | AddTextLogger (TextWriter writer) |
Sets the text writer to which reporting is also performed. | |
bool | AddTextLogger (TextWriter writer, bool writeintro) |
Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument. | |
bool | AddTextLogger (TextWriter writer, bool writeintro, bool disposewriter) |
Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument. | |
bool | AddTextLogger (Stream stream) |
Creates a TextLogger from the stream and adds it to the list of TextLoggers on which reporting is also performed. | |
bool | AddTextLogger (Stream stream, bool writeintro) |
Creates a TextLogger from the stream and adds it to the list of TextLoggers on which reporting is also performed. Overrides the writeintro property by the 'writeintro' argument. | |
bool | AddTextLogger (Stream stream, bool writeintro, bool disposewriter) |
Creates a TextLogger from the stream and adds it to the list of TextLoggers on which reporting is also performed. Overrides the writeintro property by the 'writeintro' argument. | |
bool | AddTextLogger (string filename) |
Creates a TextLogger from the file name and adds it to the list of TextLoggers on which reporting is also performed. The file is overwritten. | |
bool | AddTextLogger (string filename, bool append) |
Creates a TextLogger from the stream and adds it to the list of TextLoggers on which reporting is also performed. The caller specifies either to overwrite the file or to append to it. | |
bool | AddTextLogger (string filename, bool append, bool writeintro) |
Creates a TextLogger from the stream and adds it to the list of TextLoggers on which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins. | |
bool | AddTextLogger (string filename, bool append, bool writeintro, bool disposewriter) |
Creates a TextLogger from the stream and adds it to the list of TextLoggers on which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins. | |
bool | RemoveTextLoggers () |
Removes all text writers from the TextLogger subsystem. If appropriate, the corresponding text writer is closed. | |
bool | RemoveTextLogger () |
Removes the default text writer from the TextLogger subsystem. If appropriate, the corresponding txt writer is closed. | |
bool | RemoveTextLogger (TextWriter writer) |
Removes the first object from Loggers that contains the specified TextWriter. If appropriate, the corresponding text writer is closed. | |
bool | RemoveTextLogger (Stream stream) |
Removes the first object from Loggers whose TextWriter has been created form the specified stream. If appropriate, the corresponding text writer is closed. | |
bool | RemoveTextLogger (string filename) |
Removes the first object from Loggers whose TextWriter has been created form the file with the specified name. If appropriate, the corresponding text writer is closed. | |
List< TextWriter > | TextLoggerWriters () |
Returns a list of all text writers that are currently used by the reporter's text logger. Only text writers that are actually writable are included. | |
List< TextWriter > | TextLoggerWriters (bool writableonly) |
Returns a list of all text writers that are currently used by the reporter's text logger. Warning: Beware of thread safety issues! Blocks of code where the returned list is used should be enclosed in lock(reporter.lockobj){...} block (where reporter is the object through which this method was called). | |
int | TextLoggerNumWriters () |
Returns the current number of text writers used by the reporter's text logging module. Only text writers that are actually writable are counted. | |
int | TextLoggerNumWriters (bool writableonly) |
Returns the current number of TextWriters used by the reporter's text logging module. | |
int | TextLoggerFlush () |
Flushes all text writers of the Writer's TextLogger subsystem. | |
int | TextLoggerWrite (string str) |
Writes a string to all text writers of the Writer's TextLogger subsystem. | |
int | TextLoggerWriteLine (string str) |
Similar to TextLoggerWrite(), except that a newline is added at the end of the string. | |
Properties | |
bool | UseTextLogger [get, set] |
Specifies whether or not TextLogger(s) are used by the Reporter to log messages. | |
int | TextLoggerIndentInitial [get, set] |
Gets or sets number fo initial indentation charactyers. | |
int | TextLoggerIndentSpacing [get, set] |
Gets or sets the number of indentation characters written per indentation level. | |
char | TextLoggerIndentCharacter [get, set] |
Gets or sets the indentation character. | |
string | TextLoggerIntroText [get, set] |
Gets or sets the introduction string that is written before logging to a TextLogger begins. If this is not specified then the reporter composes its own introduction string, eventually using programname (when defined). | |
string | TextLoggerProgramName [get, set] |
String denoting the name of the program or other entity that uses the Reporter for logging. When introtext is not specified, this name is used in the introduction text composed by the reporter. | |
bool | TextLoggerWriteIntro [get, set] |
Specifies whether introduction text is written before logging of messages begins or not. |
Reporters that utilize logging messages to files. IReporterTextLogger typically outputs (to a file) messages in one-line format with possibility to define indentation, while IReporterTextWriter typically outputs multi-line messages formatted for increased visibility.
bool IG::Lib::IReporterTextLogger::SetTextLogger | ( | TextWriter | writer | ) |
Sets the text writer to which reporting is also performed.
writer | Textwriter to which reporting will be performed. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::SetTextLogger | ( | TextWriter | writer, |
bool | writeintro | ||
) |
Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument.
writer | Textwriter to which reporting will be performed. |
writeintro | Overrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::SetTextLogger | ( | TextWriter | writer, |
bool | writeintro, | ||
bool | disposewriter | ||
) |
Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument.
writer | Textwriter to which reporting will be performed. |
writeintro | Overrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties. |
disposewriter | Indicates whether the TextLogger should be disposed when not used any more. Default is false when specifying a textwriter. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::SetTextLogger | ( | Stream | stream | ) |
Creates a TextLogger upon the stream and sets it as the text writer to which reporting is also performed.
writer | Stream to which reporting will be performed. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::SetTextLogger | ( | Stream | stream, |
bool | writeintro | ||
) |
Creates a TextLogger upon the stream and sets it as the basic TextLogger to which reporting is performed. Overrides the writeintro property by the 'writeintro' argument.
writer | Textwriter to which reporting will be performed. |
writeintro | Overrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::SetTextLogger | ( | Stream | stream, |
bool | writeintro, | ||
bool | disposewriter | ||
) |
Creates a TextLogger upon the stream and sets it as the basic TextLogger to which reporting is performed. Overrides the writeintro property by the 'writeintro' argument.
writer | Textwriter to which reporting will be performed. |
writeintro | Overrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties. |
disposewriter | Indicates whether the TextLogger should be disposed when not used any more. Default is false when specifying a stream. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::SetTextLogger | ( | string | filename | ) |
Creates a TextLogger upon a file and sets it as the basic TextLogger to which reporting is also performed. The file is overwritten.
filename | Name of the file to which reporting will be performed. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::SetTextLogger | ( | string | filename, |
bool | append | ||
) |
Creates a TextLogger upon a file and sets it as the basic TextLogger to which reporting is also performed, where the caller specifies either to overwrite the file or to append to it.
filename | Name of the file to which reporting will be performed. |
append | If false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::SetTextLogger | ( | string | filename, |
bool | append, | ||
bool | writeintro | ||
) |
Creates a TextLogger upon a file and sets it as the text writer to which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins.
filename | Name of the file to which reporting will be performed. |
append | If false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file. |
writeintro | Overrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::SetTextLogger | ( | string | filename, |
bool | append, | ||
bool | writeintro, | ||
bool | disposewriter | ||
) |
Creates a TextLogger upon a file and sets it as the text writer to which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins.
filename | Name of the file to which reporting will be performed. |
append | If false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file. |
writeintro | Overrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties. |
disposewriter | Indicates whether the TextLogger should be disposed when not used any more. Default is true when specifying a file name. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::AddTextLogger | ( | TextWriter | writer | ) |
Sets the text writer to which reporting is also performed.
writer | Textwriter to which reporting will be performed. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::AddTextLogger | ( | TextWriter | writer, |
bool | writeintro | ||
) |
Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument.
writer | Textwriter to which reporting will be performed. |
writeintro | Overrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::AddTextLogger | ( | TextWriter | writer, |
bool | writeintro, | ||
bool | disposewriter | ||
) |
Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument.
writer | Textwriter to which reporting will be performed. |
writeintro | Overrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties. |
disposewriter | Indicates whether the TextLogger should be disposed when not used any more. Default is false when specifying a textwriter. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::AddTextLogger | ( | Stream | stream | ) |
Creates a TextLogger from the stream and adds it to the list of TextLoggers on which reporting is also performed.
writer | Stream to which reporting will be performed. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::AddTextLogger | ( | Stream | stream, |
bool | writeintro | ||
) |
Creates a TextLogger from the stream and adds it to the list of TextLoggers on which reporting is also performed. Overrides the writeintro property by the 'writeintro' argument.
writer | Textwriter to which reporting will be performed. |
writeintro | Overrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::AddTextLogger | ( | Stream | stream, |
bool | writeintro, | ||
bool | disposewriter | ||
) |
Creates a TextLogger from the stream and adds it to the list of TextLoggers on which reporting is also performed. Overrides the writeintro property by the 'writeintro' argument.
writer | Textwriter to which reporting will be performed. |
writeintro | Overrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties. |
disposewriter | Indicates whether the TextLogger should be disposed when not used any more. Default is false when specifying a stream. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::AddTextLogger | ( | string | filename | ) |
Creates a TextLogger from the file name and adds it to the list of TextLoggers on which reporting is also performed. The file is overwritten.
filename | Name of the file to which reporting will be performed. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::AddTextLogger | ( | string | filename, |
bool | append | ||
) |
Creates a TextLogger from the stream and adds it to the list of TextLoggers on which reporting is also performed. The caller specifies either to overwrite the file or to append to it.
filename | Name of the file to which reporting will be performed. |
append | If false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::AddTextLogger | ( | string | filename, |
bool | append, | ||
bool | writeintro | ||
) |
Creates a TextLogger from the stream and adds it to the list of TextLoggers on which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins.
filename | Name of the file to which reporting will be performed. |
append | If false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file. |
writeintro | Overrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::AddTextLogger | ( | string | filename, |
bool | append, | ||
bool | writeintro, | ||
bool | disposewriter | ||
) |
Creates a TextLogger from the stream and adds it to the list of TextLoggers on which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins.
filename | Name of the file to which reporting will be performed. |
append | If false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file. |
writeintro | Overrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties. |
disposewriter | Indicates whether the TextLogger should be disposed when not used any more. Default is true when specifying a file name. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::RemoveTextLoggers | ( | ) |
Removes all text writers from the TextLogger subsystem. If appropriate, the corresponding text writer is closed.
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::RemoveTextLogger | ( | ) |
Removes the default text writer from the TextLogger subsystem. If appropriate, the corresponding txt writer is closed.
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::RemoveTextLogger | ( | TextWriter | writer | ) |
Removes the first object from Loggers that contains the specified TextWriter. If appropriate, the corresponding text writer is closed.
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::RemoveTextLogger | ( | Stream | stream | ) |
Removes the first object from Loggers whose TextWriter has been created form the specified stream. If appropriate, the corresponding text writer is closed.
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::RemoveTextLogger | ( | string | filename | ) |
Removes the first object from Loggers whose TextWriter has been created form the file with the specified name. If appropriate, the corresponding text writer is closed.
Implemented in IG::Lib::ReporterBase.
List<TextWriter> IG::Lib::IReporterTextLogger::TextLoggerWriters | ( | ) |
Returns a list of all text writers that are currently used by the reporter's text logger. Only text writers that are actually writable are included.
Implemented in IG::Lib::ReporterBase.
List<TextWriter> IG::Lib::IReporterTextLogger::TextLoggerWriters | ( | bool | writableonly | ) |
Returns a list of all text writers that are currently used by the reporter's text logger. Warning: Beware of thread safety issues! Blocks of code where the returned list is used should be enclosed in lock(reporter.lockobj){...} block (where reporter is the object through which this method was called).
writableonly | If true then only those text writers are listed that are actually writable. If false then all text writers are listed. |
Implemented in IG::Lib::ReporterBase.
int IG::Lib::IReporterTextLogger::TextLoggerNumWriters | ( | ) |
Returns the current number of text writers used by the reporter's text logging module. Only text writers that are actually writable are counted.
Implemented in IG::Lib::ReporterBase.
int IG::Lib::IReporterTextLogger::TextLoggerNumWriters | ( | bool | writableonly | ) |
Returns the current number of TextWriters used by the reporter's text logging module.
writableonly | If true then only those text writers are counted that are actually writable. If false then all text writers are returned. |
Implemented in IG::Lib::ReporterBase.
int IG::Lib::IReporterTextLogger::TextLoggerFlush | ( | ) |
Flushes all text writers of the Writer's TextLogger subsystem.
Implemented in IG::Lib::ReporterBase.
int IG::Lib::IReporterTextLogger::TextLoggerWrite | ( | string | str | ) |
Writes a string to all text writers of the Writer's TextLogger subsystem.
str | String to be written. |
Implemented in IG::Lib::ReporterBase.
int IG::Lib::IReporterTextLogger::TextLoggerWriteLine | ( | string | str | ) |
Similar to TextLoggerWrite(), except that a newline is added at the end of the string.
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::UseTextLogger [get, set] |
Specifies whether or not TextLogger(s) are used by the Reporter to log messages.
Implemented in IG::Lib::ReporterBase.
int IG::Lib::IReporterTextLogger::TextLoggerIndentInitial [get, set] |
Gets or sets number fo initial indentation charactyers.
Implemented in IG::Lib::ReporterBase.
int IG::Lib::IReporterTextLogger::TextLoggerIndentSpacing [get, set] |
Gets or sets the number of indentation characters written per indentation level.
Implemented in IG::Lib::ReporterBase.
char IG::Lib::IReporterTextLogger::TextLoggerIndentCharacter [get, set] |
Gets or sets the indentation character.
Implemented in IG::Lib::ReporterBase.
string IG::Lib::IReporterTextLogger::TextLoggerIntroText [get, set] |
Gets or sets the introduction string that is written before logging to a TextLogger begins. If this is not specified then the reporter composes its own introduction string, eventually using programname (when defined).
Implemented in IG::Lib::ReporterBase.
string IG::Lib::IReporterTextLogger::TextLoggerProgramName [get, set] |
String denoting the name of the program or other entity that uses the Reporter for logging. When introtext is not specified, this name is used in the introduction text composed by the reporter.
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextLogger::TextLoggerWriteIntro [get, set] |
Specifies whether introduction text is written before logging of messages begins or not.
Implemented in IG::Lib::ReporterBase.