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

IG::Lib::Logger Class Reference

Temporary logging of errors, warnings and infos for later processing. It is used to log multiple events in order to be processed (reported or otherwise) later. More...

List of all members.

Public Member Functions

void Clear ()
 Removes all logs (if any) currently on the logger.
void Report (IReporter reporter)
 Reports all logs contained in this logger by the specified reporter.
void ReportAndClear (IReporter reporter)
 Reports all logs contained in this logger by the specified reporter, then clears the logger (removes all logs from it).
bool HasLogs ()
 Returns true if logger contains any logs (of any type), false otherwise.
bool HasLogs (ReportType type)
 Returns true if logger contains any logs of the specified type, false otherwise.
bool HasErrors ()
 Returns true if logger contains any error logs false otherwise.
bool HasWarnings ()
 Returns true if logger contains any warning logs false otherwise.
bool HasInfos ()
 Returns true if logger contains any info logs false otherwise.
int NumLogs ()
 Returns number of logs (of any type) that logger contains.
int NumLogs (ReportType type)
 Returns number of logs of the specified type that logger contains.
int NumErrors ()
 Returns number of error logs that logger contains.
int NumWarnings ()
 Returns number of warning logs that logger contains.
int NumInfos ()
 Returns number of info logs that logger contains.
string GetReport (ReportLevel level, bool printDecorations, bool newLinesAfter)
 Returns a stirng that contains reports for all logs contained in the logger.
string GetReport (ReportLevel level)
 Returns a stirng that contains reports for all logs contained in the logger. Decorations are printed around reports. A newline is printed after each report.
string GetReport ()
 Returns a stirng that contains reports for all logs contained in the logger. Reporting level is Info. Decorations are printed around reports. A newline is printed after each report.
string GetErrorsReport (bool printDecorations, bool newLinesAfter)
 Returns a string that contains reports for all errors contained in the logger. If there are no logs to be reported then an empty string is returned.
string GetErrorsReport ()
 Returns a string that contains reports for all errors contained in the logger. If there are no logs to be reported then an empty string is returned.
string GetWarningsReport (bool printDecorations, bool newLinesAfter)
 Returns a string that contains reports for all warnings contained in the logger. If there are no logs to be reported then an empty string is returned.
string GetWarningsReport ()
 Returns a string that contains reports for all warnings contained in the logger. If there are no logs to be reported then an empty string is returned.
string GetInfosReport (bool printDecorations, bool newLinesAfter)
 Returns a string that contains reports for all infos contained in the logger. If there are no logs to be reported then an empty string is returned.
string GetInfosReport ()
 Returns a string that contains reports for all infos contained in the logger. If there are no logs to be reported then an empty string is returned. Decorations are not printed. A newline is printed after each report.
void Log (ReportType messagetype, string location, string message, Exception ex)
 Adds a new log record initialized according to parameters.
void Log (ReportType messagetype, string message, Exception ex)
 Adds a new log record initialized according to parameters.
void Log (ReportType messagetype, Exception ex, string location)
 Adds a new log record initialized according to parameters.
void Log (ReportType messagetype, Exception ex)
 Adds a new log record initialized according to parameters.
void Log (ReportType messagetype, string location, string message)
 Adds a new log record initialized according to parameters.
void Log (ReportType messagetype, string message)
 Adds a new log record initialized according to parameters.
void LogError (string location, string message, Exception ex)
 Adds a new error log record initialized according to parameters.
void LogError (string message, Exception ex)
 Adds a new error log record initialized according to parameters.
void LogError (Exception ex, string location)
 Adds a new error log record initialized according to parameters.
void LogError (Exception ex)
 Adds a new error log record initialized according to parameters.
void LogError (string location, string message)
 Adds a new error log record initialized according to parameters.
void LogError (string message)
 Adds a new error log record initialized according to parameters.
void LogWarning (string location, string message, Exception ex)
 Adds a new warning log record initialized according to parameters.
void LogWarning (string message, Exception ex)
 Adds a new warning log record initialized according to parameters.
void LogWarning (Exception ex, string location)
 Adds a new warning log record initialized according to parameters.
void LogWarning (Exception ex)
 Adds a new warning log record initialized according to parameters.
void LogWarning (string location, string message)
 Adds a new warning log record initialized according to parameters.
void LogWarning (string message)
 Adds a new warning log record initialized according to parameters.
void LogInfo (string location, string message)
 Adds a new info log record initialized according to parameters.
void LogInfo (string message)
 Adds a new info log record initialized according to parameters.

Protected Member Functions

virtual void PrintReport (LogRecord logRecord, StringBuilder sb, bool printDecoration, bool newLineAfter)
 Prints an short report corresponding to the specified log record to the specified StringBuilder. Auxiliary methof used to generate various condensed reports without using a separate reporter.

Properties

List< LogRecordLogs [get]
 Logs that are currently on logger.

Private Attributes

List< LogRecord_logs = new List<LogRecord>()

Detailed Description

Temporary logging of errors, warnings and infos for later processing. It is used to log multiple events in order to be processed (reported or otherwise) later.

$A Igor Jun10;


Member Function Documentation

void IG::Lib::Logger::Clear ( ) [inline]

Removes all logs (if any) currently on the logger.

void IG::Lib::Logger::Report ( IReporter  reporter) [inline]

Reports all logs contained in this logger by the specified reporter.

Parameters:
reporterReporter used to report logged messages.
void IG::Lib::Logger::ReportAndClear ( IReporter  reporter) [inline]

Reports all logs contained in this logger by the specified reporter, then clears the logger (removes all logs from it).

Parameters:
reporterReporter used to report logged messages.
bool IG::Lib::Logger::HasLogs ( ) [inline]

Returns true if logger contains any logs (of any type), false otherwise.

bool IG::Lib::Logger::HasLogs ( ReportType  type) [inline]

Returns true if logger contains any logs of the specified type, false otherwise.

bool IG::Lib::Logger::HasErrors ( ) [inline]

Returns true if logger contains any error logs false otherwise.

bool IG::Lib::Logger::HasWarnings ( ) [inline]

Returns true if logger contains any warning logs false otherwise.

bool IG::Lib::Logger::HasInfos ( ) [inline]

Returns true if logger contains any info logs false otherwise.

int IG::Lib::Logger::NumLogs ( ) [inline]

Returns number of logs (of any type) that logger contains.

Returns:
int IG::Lib::Logger::NumLogs ( ReportType  type) [inline]

Returns number of logs of the specified type that logger contains.

int IG::Lib::Logger::NumErrors ( ) [inline]

Returns number of error logs that logger contains.

int IG::Lib::Logger::NumWarnings ( ) [inline]

Returns number of warning logs that logger contains.

int IG::Lib::Logger::NumInfos ( ) [inline]

Returns number of info logs that logger contains.

virtual void IG::Lib::Logger::PrintReport ( LogRecord  logRecord,
StringBuilder  sb,
bool  printDecoration,
bool  newLineAfter 
) [inline, protected, virtual]

Prints an short report corresponding to the specified log record to the specified StringBuilder. Auxiliary methof used to generate various condensed reports without using a separate reporter.

Parameters:
logLog record whose information is printed.
sbStringBuilder to which information is printed.
printDecorationWhethr a decoration is printed around the report (indicates e.g. type of the reported log record - Error, Warning, Info)
newLineAfterWhether a newline is printed after the report.
string IG::Lib::Logger::GetReport ( ReportLevel  level,
bool  printDecorations,
bool  newLinesAfter 
) [inline]

Returns a stirng that contains reports for all logs contained in the logger.

Parameters:
levelReporting level, logs whose level is greater than prescribed level are not printed.
printDecorationsWhether decorations are printed or not. Decorations outline individual reports and hod information on report types.
newLinesAfterWhether newlines are printed after individual reports.
string IG::Lib::Logger::GetReport ( ReportLevel  level) [inline]

Returns a stirng that contains reports for all logs contained in the logger. Decorations are printed around reports. A newline is printed after each report.

Parameters:
levelReporting level, logs whose level is greater than prescribed level are not printed.
string IG::Lib::Logger::GetReport ( ) [inline]

Returns a stirng that contains reports for all logs contained in the logger. Reporting level is Info. Decorations are printed around reports. A newline is printed after each report.

Parameters:
levelReporting level, logs whose level is greater than prescribed level are not printed.
string IG::Lib::Logger::GetErrorsReport ( bool  printDecorations,
bool  newLinesAfter 
) [inline]

Returns a string that contains reports for all errors contained in the logger. If there are no logs to be reported then an empty string is returned.

Parameters:
printDecorationsWhether decorations are printed or not. Decorations outline individual reports and hod information on report types.
newLinesAfterWhether newlines are printed after individual reports.
string IG::Lib::Logger::GetErrorsReport ( ) [inline]

Returns a string that contains reports for all errors contained in the logger. If there are no logs to be reported then an empty string is returned.

string IG::Lib::Logger::GetWarningsReport ( bool  printDecorations,
bool  newLinesAfter 
) [inline]

Returns a string that contains reports for all warnings contained in the logger. If there are no logs to be reported then an empty string is returned.

Parameters:
printDecorationsWhether decorations are printed or not. Decorations outline individual reports and hod information on report types.
newLinesAfterWhether newlines are printed after individual reports.
string IG::Lib::Logger::GetWarningsReport ( ) [inline]

Returns a string that contains reports for all warnings contained in the logger. If there are no logs to be reported then an empty string is returned.

string IG::Lib::Logger::GetInfosReport ( bool  printDecorations,
bool  newLinesAfter 
) [inline]

Returns a string that contains reports for all infos contained in the logger. If there are no logs to be reported then an empty string is returned.

Parameters:
printDecorationsWhether decorations are printed or not. Decorations outline individual reports and hod information on report types.
newLinesAfterWhether newlines are printed after individual reports.
string IG::Lib::Logger::GetInfosReport ( ) [inline]

Returns a string that contains reports for all infos contained in the logger. If there are no logs to be reported then an empty string is returned. Decorations are not printed. A newline is printed after each report.

void IG::Lib::Logger::Log ( ReportType  messagetype,
string  location,
string  message,
Exception  ex 
) [inline]

Adds a new log record initialized according to parameters.

Parameters:
messagetypeType of the logged record.
locationDescription of location where logging occurred.
messageMessage (or additional explanation) to be logged.
exException that caused creation of log record.
void IG::Lib::Logger::Log ( ReportType  messagetype,
string  message,
Exception  ex 
) [inline]

Adds a new log record initialized according to parameters.

Parameters:
messagetypeType of the logged record.
messageMessage (or additional explanation) to be logged.
exException that caused creation of log record.
void IG::Lib::Logger::Log ( ReportType  messagetype,
Exception  ex,
string  location 
) [inline]

Adds a new log record initialized according to parameters.

Parameters:
messagetypeType of the logged record.
exException that caused creation of log record.
locationDescription of location where logging occurred.
void IG::Lib::Logger::Log ( ReportType  messagetype,
Exception  ex 
) [inline]

Adds a new log record initialized according to parameters.

Parameters:
messagetypeType of the logged record.
exException that caused creation of log record.
void IG::Lib::Logger::Log ( ReportType  messagetype,
string  location,
string  message 
) [inline]

Adds a new log record initialized according to parameters.

Parameters:
messagetypeType of the logged record.
locationDescription of location where logging occurred.
messageMessage (or additional explanation) to be logged.
void IG::Lib::Logger::Log ( ReportType  messagetype,
string  message 
) [inline]

Adds a new log record initialized according to parameters.

Parameters:
messagetypeType of the logged record.
messageMessage (or additional explanation) to be logged.
void IG::Lib::Logger::LogError ( string  location,
string  message,
Exception  ex 
) [inline]

Adds a new error log record initialized according to parameters.

Parameters:
locationDescription of location where logging occurred.
messageMessage (or additional explanation) to be logged.
exException that caused creation of log record.
void IG::Lib::Logger::LogError ( string  message,
Exception  ex 
) [inline]

Adds a new error log record initialized according to parameters.

Parameters:
messageMessage (or additional explanation) to be logged.
exException that caused creation of log record.
void IG::Lib::Logger::LogError ( Exception  ex,
string  location 
) [inline]

Adds a new error log record initialized according to parameters.

Parameters:
exException that caused creation of log record.
locationDescription of location where logging occurred.
void IG::Lib::Logger::LogError ( Exception  ex) [inline]

Adds a new error log record initialized according to parameters.

Parameters:
exException that caused creation of log record.
void IG::Lib::Logger::LogError ( string  location,
string  message 
) [inline]

Adds a new error log record initialized according to parameters.

Parameters:
locationDescription of location where logging occurred.
messageMessage (or additional explanation) to be logged.
void IG::Lib::Logger::LogError ( string  message) [inline]

Adds a new error log record initialized according to parameters.

Parameters:
messageMessage (or additional explanation) to be logged.
void IG::Lib::Logger::LogWarning ( string  location,
string  message,
Exception  ex 
) [inline]

Adds a new warning log record initialized according to parameters.

Parameters:
locationDescription of location where logging occurred.
messageMessage (or additional explanation) to be logged.
exException that caused creation of log record.
void IG::Lib::Logger::LogWarning ( string  message,
Exception  ex 
) [inline]

Adds a new warning log record initialized according to parameters.

Parameters:
messageMessage (or additional explanation) to be logged.
exException that caused creation of log record.
void IG::Lib::Logger::LogWarning ( Exception  ex,
string  location 
) [inline]

Adds a new warning log record initialized according to parameters.

Parameters:
exException that caused creation of log record.
locationDescription of location where logging occurred.
void IG::Lib::Logger::LogWarning ( Exception  ex) [inline]

Adds a new warning log record initialized according to parameters.

Parameters:
exException that caused creation of log record.
void IG::Lib::Logger::LogWarning ( string  location,
string  message 
) [inline]

Adds a new warning log record initialized according to parameters.

Parameters:
locationDescription of location where logging occurred.
messageMessage (or additional explanation) to be logged.
void IG::Lib::Logger::LogWarning ( string  message) [inline]

Adds a new warning log record initialized according to parameters.

Parameters:
messageMessage (or additional explanation) to be logged.
void IG::Lib::Logger::LogInfo ( string  location,
string  message 
) [inline]

Adds a new info log record initialized according to parameters.

Parameters:
locationDescription of location where logging occurred.
messageMessage (or additional explanation) to be logged.
void IG::Lib::Logger::LogInfo ( string  message) [inline]

Adds a new info log record initialized according to parameters.

Parameters:
messageMessage (or additional explanation) to be logged.

Member Data Documentation

List<LogRecord> IG::Lib::Logger::_logs = new List<LogRecord>() [private]

Property Documentation

List<LogRecord> IG::Lib::Logger::Logs [get, protected]

Logs that are currently on logger.


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