IGLib
1.7.2
The IGLib base library for development of numerical, technical and business applications.
|
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...
Public Member Functions | |
void | Clear () |
Removes all logs (if any) currently on the logger. More... | |
void | Report (IReporter reporter) |
Reports all logs contained in this logger by the specified reporter. More... | |
void | ReportAndClear (IReporter reporter) |
Reports all logs contained in this logger by the specified reporter, then clears the logger (removes all logs from it). More... | |
bool | HasLogs () |
Returns true if logger contains any logs (of any type), false otherwise. More... | |
bool | HasLogs (ReportType type) |
Returns true if logger contains any logs of the specified type, false otherwise. More... | |
bool | HasErrors () |
Returns true if logger contains any error logs false otherwise. More... | |
bool | HasWarnings () |
Returns true if logger contains any warning logs false otherwise. More... | |
bool | HasInfos () |
Returns true if logger contains any info logs false otherwise. More... | |
int | NumLogs () |
Returns number of logs (of any type) that logger contains. More... | |
int | NumLogs (ReportType type) |
Returns number of logs of the specified type that logger contains. More... | |
int | NumErrors () |
Returns number of error logs that logger contains. More... | |
int | NumWarnings () |
Returns number of warning logs that logger contains. More... | |
int | NumInfos () |
Returns number of info logs that logger contains. More... | |
string | GetReport (ReportLevel level, bool printDecorations, bool newLinesAfter) |
Returns a stirng that contains reports for all logs contained in the logger. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
void | Log (ReportType messagetype, string location, string message, Exception ex) |
Adds a new log record initialized according to parameters. More... | |
void | Log (ReportType messagetype, string message, Exception ex) |
Adds a new log record initialized according to parameters. More... | |
void | Log (ReportType messagetype, Exception ex, string location) |
Adds a new log record initialized according to parameters. More... | |
void | Log (ReportType messagetype, Exception ex) |
Adds a new log record initialized according to parameters. More... | |
void | Log (ReportType messagetype, string location, string message) |
Adds a new log record initialized according to parameters. More... | |
void | Log (ReportType messagetype, string message) |
Adds a new log record initialized according to parameters. More... | |
void | LogError (string location, string message, Exception ex) |
Adds a new error log record initialized according to parameters. More... | |
void | LogError (string message, Exception ex) |
Adds a new error log record initialized according to parameters. More... | |
void | LogError (Exception ex, string location) |
Adds a new error log record initialized according to parameters. More... | |
void | LogError (Exception ex) |
Adds a new error log record initialized according to parameters. More... | |
void | LogError (string location, string message) |
Adds a new error log record initialized according to parameters. More... | |
void | LogError (string message) |
Adds a new error log record initialized according to parameters. More... | |
void | LogWarning (string location, string message, Exception ex) |
Adds a new warning log record initialized according to parameters. More... | |
void | LogWarning (string message, Exception ex) |
Adds a new warning log record initialized according to parameters. More... | |
void | LogWarning (Exception ex, string location) |
Adds a new warning log record initialized according to parameters. More... | |
void | LogWarning (Exception ex) |
Adds a new warning log record initialized according to parameters. More... | |
void | LogWarning (string location, string message) |
Adds a new warning log record initialized according to parameters. More... | |
void | LogWarning (string message) |
Adds a new warning log record initialized according to parameters. More... | |
void | LogInfo (string location, string message) |
Adds a new info log record initialized according to parameters. More... | |
void | LogInfo (string message) |
Adds a new info log record initialized according to parameters. More... | |
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. More... | |
Properties | |
List< LogRecord > | Logs [get] |
Logs that are currently on logger. More... | |
Private Attributes | |
List< LogRecord > | _logs = new List<LogRecord>() |
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;
|
inline |
Removes all logs (if any) currently on the logger.
Referenced by IG.Lib.ScriptLoaderBase.ClearLogger().
|
inline |
Reports all logs contained in this logger by the specified reporter.
reporter | Reporter used to report logged messages. |
References IG.Lib.LogRecord.Ex, IG.Lib.LogRecord.Location, IG.Lib.LogRecord.Message, and IG.Lib.LogRecord.Type.
|
inline |
Reports all logs contained in this logger by the specified reporter, then clears the logger (removes all logs from it).
reporter | Reporter used to report logged messages. |
|
inline |
Returns true if logger contains any logs (of any type), false otherwise.
|
inline |
Returns true if logger contains any logs of the specified type, false otherwise.
References IG.Lib.LogRecord.Type.
|
inline |
Returns true if logger contains any error logs false otherwise.
|
inline |
Returns true if logger contains any warning logs false otherwise.
|
inline |
Returns true if logger contains any info logs false otherwise.
|
inline |
Returns number of logs (of any type) that logger contains.
|
inline |
Returns number of logs of the specified type that logger contains.
References IG.Lib.LogRecord.Type.
|
inline |
Returns number of error logs that logger contains.
|
inline |
Returns number of warning logs that logger contains.
|
inline |
Returns number of info logs that logger contains.
|
inlineprotectedvirtual |
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.
logRecord | Log record whose information is printed. |
sb | StringBuilder to which information is printed. |
printDecoration | Whethr a decoration is printed around the report (indicates e.g. type of the reported log record - Error, Warning, Info) |
newLineAfter | Whether a newline is printed after the report. |
References IG.Lib.LogRecord.Ex, IG.Lib.LogRecord.Location, IG.Lib.LogRecord.Message, and IG.Lib.LogRecord.Type.
|
inline |
Returns a stirng that contains reports for all logs contained in the logger.
level | Reporting level, logs whose level is greater than prescribed level are not printed. |
printDecorations | Whether decorations are printed or not. Decorations outline individual reports and hod information on report types. |
newLinesAfter | Whether newlines are printed after individual reports. |
References IG.Lib.LogRecord.Type.
|
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.
level | Reporting level, logs whose level is greater than prescribed level are not printed. |
|
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.
|
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.
printDecorations | Whether decorations are printed or not. Decorations outline individual reports and hod information on report types. |
newLinesAfter | Whether newlines are printed after individual reports. |
References IG.Lib.LogRecord.Type.
Referenced by IG.Lib.ScriptLoaderBase.Compile().
|
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.
|
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.
printDecorations | Whether decorations are printed or not. Decorations outline individual reports and hod information on report types. |
newLinesAfter | Whether newlines are printed after individual reports. |
References IG.Lib.LogRecord.Type.
|
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.
|
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.
printDecorations | Whether decorations are printed or not. Decorations outline individual reports and hod information on report types. |
newLinesAfter | Whether newlines are printed after individual reports. |
References IG.Lib.LogRecord.Type.
|
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.
|
inline |
Adds a new log record initialized according to parameters.
messagetype | Type of the logged record. |
location | Description of location where logging occurred. |
message | Message (or additional explanation) to be logged. |
ex | Exception that caused creation of log record. |
|
inline |
Adds a new log record initialized according to parameters.
messagetype | Type of the logged record. |
message | Message (or additional explanation) to be logged. |
ex | Exception that caused creation of log record. |
|
inline |
Adds a new log record initialized according to parameters.
messagetype | Type of the logged record. |
ex | Exception that caused creation of log record. |
location | Description of location where logging occurred. |
|
inline |
Adds a new log record initialized according to parameters.
messagetype | Type of the logged record. |
ex | Exception that caused creation of log record. |
|
inline |
Adds a new log record initialized according to parameters.
messagetype | Type of the logged record. |
location | Description of location where logging occurred. |
message | Message (or additional explanation) to be logged. |
|
inline |
Adds a new log record initialized according to parameters.
messagetype | Type of the logged record. |
message | Message (or additional explanation) to be logged. |
|
inline |
Adds a new error log record initialized according to parameters.
location | Description of location where logging occurred. |
message | Message (or additional explanation) to be logged. |
ex | Exception that caused creation of log record. |
Referenced by IG.Lib.ScriptLoaderBase.Compile().
|
inline |
Adds a new error log record initialized according to parameters.
message | Message (or additional explanation) to be logged. |
ex | Exception that caused creation of log record. |
|
inline |
Adds a new error log record initialized according to parameters.
ex | Exception that caused creation of log record. |
location | Description of location where logging occurred. |
|
inline |
Adds a new error log record initialized according to parameters.
ex | Exception that caused creation of log record. |
|
inline |
Adds a new error log record initialized according to parameters.
location | Description of location where logging occurred. |
message | Message (or additional explanation) to be logged. |
|
inline |
Adds a new error log record initialized according to parameters.
message | Message (or additional explanation) to be logged. |
|
inline |
Adds a new warning log record initialized according to parameters.
location | Description of location where logging occurred. |
message | Message (or additional explanation) to be logged. |
ex | Exception that caused creation of log record. |
Referenced by IG.Lib.ScriptLoaderBase.AddReferencedAssemblies(), IG.Lib.ScriptLoaderBase.CheckAndCorrectNames(), and IG.Lib.ScriptLoaderBase.Compile().
|
inline |
Adds a new warning log record initialized according to parameters.
message | Message (or additional explanation) to be logged. |
ex | Exception that caused creation of log record. |
|
inline |
Adds a new warning log record initialized according to parameters.
ex | Exception that caused creation of log record. |
location | Description of location where logging occurred. |
|
inline |
Adds a new warning log record initialized according to parameters.
ex | Exception that caused creation of log record. |
|
inline |
Adds a new warning log record initialized according to parameters.
location | Description of location where logging occurred. |
message | Message (or additional explanation) to be logged. |
|
inline |
Adds a new warning log record initialized according to parameters.
message | Message (or additional explanation) to be logged. |
|
inline |
Adds a new info log record initialized according to parameters.
location | Description of location where logging occurred. |
message | Message (or additional explanation) to be logged. |
Referenced by IG.Lib.ScriptLoaderBase.Compile().
|
inline |
Adds a new info log record initialized according to parameters.
message | Message (or additional explanation) to be logged. |
|
getprotected |
Logs that are currently on logger.