IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.

IG::Lib::IReporterTextLogger Interface Reference

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...

Inheritance diagram for IG::Lib::IReporterTextLogger:
Collaboration diagram for IG::Lib::IReporterTextLogger:

List of all members.

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.

Detailed Description

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.


Member Function Documentation

bool IG::Lib::IReporterTextLogger::SetTextLogger ( TextWriter  writer)

Sets the text writer to which reporting is also performed.

Parameters:
writerTextwriter to which reporting will be performed.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

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.

Parameters:
writerTextwriter to which reporting will be performed.
writeintroOverrides 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.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

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.

Parameters:
writerTextwriter to which reporting will be performed.
writeintroOverrides 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.
disposewriterIndicates whether the TextLogger should be disposed when not used any more. Default is false when specifying a textwriter.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

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.

Parameters:
writerStream to which reporting will be performed.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

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.

Parameters:
writerTextwriter to which reporting will be performed.
writeintroOverrides 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.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

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.

Parameters:
writerTextwriter to which reporting will be performed.
writeintroOverrides 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.
disposewriterIndicates whether the TextLogger should be disposed when not used any more. Default is false when specifying a stream.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

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.

Parameters:
filenameName of the file to which reporting will be performed.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

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.

Parameters:
filenameName of the file to which reporting will be performed.
appendIf false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

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.

Parameters:
filenameName of the file to which reporting will be performed.
appendIf false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file.
writeintroOverrides 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.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

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.

Parameters:
filenameName of the file to which reporting will be performed.
appendIf false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file.
writeintroOverrides 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.
disposewriterIndicates whether the TextLogger should be disposed when not used any more. Default is true when specifying a file name.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextLogger::AddTextLogger ( TextWriter  writer)

Sets the text writer to which reporting is also performed.

Parameters:
writerTextwriter to which reporting will be performed.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

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.

Parameters:
writerTextwriter to which reporting will be performed.
writeintroOverrides 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.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

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.

Parameters:
writerTextwriter to which reporting will be performed.
writeintroOverrides 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.
disposewriterIndicates whether the TextLogger should be disposed when not used any more. Default is false when specifying a textwriter.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

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.

Parameters:
writerStream to which reporting will be performed.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

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.

Parameters:
writerTextwriter to which reporting will be performed.
writeintroOverrides 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.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

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.

Parameters:
writerTextwriter to which reporting will be performed.
writeintroOverrides 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.
disposewriterIndicates whether the TextLogger should be disposed when not used any more. Default is false when specifying a stream.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

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.

Parameters:
filenameName of the file to which reporting will be performed.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

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.

Parameters:
filenameName of the file to which reporting will be performed.
appendIf false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

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.

Parameters:
filenameName of the file to which reporting will be performed.
appendIf false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file.
writeintroOverrides 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.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

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.

Parameters:
filenameName of the file to which reporting will be performed.
appendIf false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file.
writeintroOverrides 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.
disposewriterIndicates whether the TextLogger should be disposed when not used any more. Default is true when specifying a file name.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

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.

Returns:
true if al text writers were successfully removed, false if there were problems.

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.

Returns:
true if the text writer was successfully removed, false otherwise (also if there is no writer installed)

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.

Returns:
true if the text writer was successfully removed, false otherwise (also if there is no writer installed corresponding the argument)

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.

Returns:
true if the text writer was successfully removed, false otherwise (also if there is no writer installed corresponding the argument)

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.

Returns:
true if the text writer was successfully removed, false otherwise (also if there is no writer installed corresponding the argument)

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.

Returns:
List of text writers that are currently used by the reporter's text logger (only those 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).

Parameters:
writableonlyIf true then only those text writers are listed that are actually writable. If false then all text writers are listed.
Returns:
List of text writers that are currently used by the reporter's text logger.

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.

Returns:
The current number of text writers used by the reporter's text logging module (only those 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.

Parameters:
writableonlyIf true then only those text writers are counted that are actually writable. If false then all text writers are returned.
Returns:
The current number of text writers used by the reporter's text logging module.

Implemented in IG::Lib::ReporterBase.

int IG::Lib::IReporterTextLogger::TextLoggerFlush ( )

Flushes all text writers of the Writer's TextLogger subsystem.

Returns:
Number of writers that has actually been flushed.

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.

Parameters:
strString to be written.
Returns:
Number of writers that the string has actually been written to.

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.


Property Documentation

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.


The documentation for this interface was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties Events