IGLib
1.5
The IGLib base library for development of numerical, technical and business applications.
|
Base IG class for reporting, tracing and logging; provides a global reporter and a basis for creation of local reporters. This class is identical to the IGLib class (copied directly). IN EFA, refer to the derived class Reporter! More...
Public Member Functions | |
Reporter () | |
Constructor. Initializes all error reporting delegates to default values and sets auxliary object to null. Auxiliary object Obj is set to null. More... | |
Reporter (object obj, ReportDelegate reportdelegate, ReportLocationDelegate locationdelegate, ReportMessageDelegate messagedelegate, ReserveReportErrorDelegate reservereportdelegate) | |
Constructor. Initializes the error reporter by the specified auxiliary object and delegates used to perform error reporting tasks. Delegates that are not specified are set to default values. More... | |
Reporter (object obj, ReportDelegate reportdelegate, ReportLocationDelegate locationdelegate, ReportMessageDelegate messagedelegate) | |
Constructor. Initializes the error reporter by the specified auxiliary object and delegates used to perform error reporting tasks. Reserve error reporting delegate is initialized to a default value. Delegates that are not specified are set to default values. More... | |
Reporter (object obj, ReportDelegate reportdelegate) | |
Constructor. Initializes the error reporter by the specified auxiliary object and the delegate to perform error reporting tasks. Reserve error reporting delegate is initialized to a default value. Delegates for assembling the error location string and error message string are set to their default values, which are adapted to console-like eror reporting systems. More... | |
Reporter (object obj, ReportDelegate reportdelegate, ReserveReportErrorDelegate reservereportdelegate) | |
Constructor. Initializes the error reporter by the specified auxiliary object and delegates used to perform error reporting tasks. Delegates for assembling the error locatin and error message string are set to their default values, which are adapted to console-like eror reporting systems. More... | |
void | Init (object obj, ReportDelegate reportdelegate, ReportLocationDelegate locationdelegate, ReportMessageDelegate messagedelegate, ReserveReportErrorDelegate reservereportdelegate) |
Initializes the error reporter by the specified auxiliary object and delegates used to perform error reporting tasks. Delegates that are not specified are set to default values. More... | |
void | Init () |
Initializes all error reporting delegates to default values and sets auxliary object to null. Auxiliary object Obj is set to null. More... | |
void | Init (object obj, ReportDelegate reportdelegate, ReportLocationDelegate locationdelegate, ReportMessageDelegate messagedelegate) |
Initializes the error reporter by the specified auxiliary object and delegates used to perform error reporting tasks. Reserve error reporting delegate is initialized to a default value. Delegates that are not specified are set to default values. More... | |
void | Init (object obj, ReportDelegate reportdelegate) |
Initializes the error reporter by the specified auxiliary object and the delegate to perform error reporting tasks. Reserve error reporting delegate is initialized to a default value. Delegates for assembling the error location string and error message string are set to their default values, which are adapted to console-like eror reporting systems. More... | |
void | Init (object obj, ReportDelegate reportdelegate, ReserveReportErrorDelegate reservereportdelegate) |
Initializes the error reporter by the specified auxiliary object and delegates used to perform error reporting tasks. Delegates for assembling the error locatin and error message string are set to their default values, which are adapted to console-like eror reporting systems. More... | |
virtual void | ResetLevels () |
Resets the various kinds of reporting levels to default values. More... | |
bool | DoReporting (ReportType reptype) |
Returns true if the report of a given type should be shown by user interface (according to ReportingLevel), and false if not. More... | |
bool | DoLogging (ReportType reptype) |
Returns true if the report of a given type should be logged in log files (according to ReportingLevel), and false if not. More... | |
bool | DoTracing (ReportType reptype) |
Returns true if the report of a given type should traced (according to ReportingLevel), and false if not. More... | |
virtual EventLogEntryType | ReportType2EventLogEntryType (ReportType rt) |
Returns the System.Diagnostics.EventLogEntryType value corresponding to the given ReportType. Remark: FailureAudit and SuccessAudit can not be generated because they don't have representation in ReportType. More... | |
virtual ReportType | EventLogEntryType2ReportType (EventLogEntryType el) |
Returns the ReportType value corresponding to the given System.Diagnostics.EventLogEntryType. Remark: FailureAudit and SuccessAudit do not have representation in ReportType and are mapped to Error and Warning, respectively. More... | |
virtual TraceLevel | ReportLevel2TraceLevel (ReportLevel level) |
Returns the System.Diagnostics.TraceLevel value corresponding to the given ReportLevel. More... | |
virtual ReportLevel | TraceLevel2ReportLevel (TraceLevel tl) |
Returns the ReportLevel value corresponding to the given System.Diagnostics.TraceLevel. More... | |
virtual void | Report (ReportType messagetype, string location, string message, Exception ex) |
Basic reporting method (overloaded). Launches an error report, a warning report or s kind of report/message. Supplemental data (such as objects necessary to launch visualize the report or operation typeflags) are obtained from the class' instance. More... | |
void | Report (ReportType messagetype, string message, Exception ex) |
Launches a report. Predominantly for error and warning reports. More... | |
void | Report (ReportType messagetype, Exception ex, string location) |
Launches a report. Predominantly for error and warning reports. More... | |
void | Report (ReportType messagetype, Exception ex) |
Launches a report. Predominantly for error and warning reports. More... | |
void | Report (ReportType messagetype, string location, string message) |
Launches a report. More... | |
void | Report (ReportType messagetype, string message) |
Launches a report. More... | |
void | ReportError (string location, string message, Exception ex) |
Basic error reporting method (overloaded). Supplemental data (such as objects necessary to launch visualize the report or operation typeflags) are obtained from the class' instance. More... | |
void | ReportError (string message, Exception ex) |
Launches an error report. More... | |
void | ReportError (Exception ex, string location) |
Launches an error report. More... | |
void | ReportError (Exception ex) |
Launches an error report. Predominantly for error and warning reports. More... | |
void | ReportError (string location, string message) |
Launches an error report. More... | |
void | ReportError (string message) |
Launches an error report. More... | |
void | ReportWarning (string location, string message, Exception ex) |
Basic warning reporting method (overloaded). Supplemental data (such as objects necessary to launch visualize the report or operation typeflags) are obtained from the class' instance. More... | |
void | ReportWarning (string message, Exception ex) |
Launches a warning report. More... | |
void | ReportWarning (Exception ex, string location) |
Launches a warning report. More... | |
void | ReportWarning (Exception ex) |
Launches a warning report. Predominantly for error and warning reports. More... | |
void | ReportWarning (string location, string message) |
Launches a warning report. More... | |
void | ReportWarning (string message) |
Launches a warning report. More... | |
void | ReportInfo (Exception ex) |
Launches an info. More... | |
void | ReportInfo (string location, string message) |
Launches an info. More... | |
void | ReportInfo (string message) |
Launches an info. More... | |
Static Public Member Functions | |||||||||||
static bool | DoLaunch (ReportType reptype, ReportLevel replevel) | ||||||||||
Returns true if the report of a given type will be launched at the given reporting level, and false if not. More... | |||||||||||
static string | DefaultReportStringMessageBox (Reporter reporter, ReportType messagetype, string errorlocation, string errormessage) | ||||||||||
Auxiliary method that composes the complete message, including decoration, for reports launched in a message box. More... | |||||||||||
static string | DefaultReportStringConsole (Reporter reporter, ReportType messagetype, string errorlocation, string errormessage) | ||||||||||
Auxiliary method that composes the complete message, including decoration, for reports launched in consoles. More... | |||||||||||
static string | DefaultReportStringConsoleTimeStamp (Reporter reporter, ReportType messagetype, string errorlocation, string errormessage) | ||||||||||
Auxiliary method that composes the complete message, including decoration with a TIMESTAMP, for reports launched in consoles. More... | |||||||||||
static string | DefaultReportStringConsoleBas (Reporter reporter, ReportType messagetype, string errorlocation, string errormessage, bool timestamp) | ||||||||||
Base method for DefaultReportStringConsole and DefaultReportStringConsoleTimeStamp. More... | |||||||||||
static void | DefaultReportConsole (Reporter reporter, ReportType messagetype, string errorlocation, string errormessage) | ||||||||||
Default delegate for reporting. For parameter descriptions, see ReportDlg. More... | |||||||||||
static string | DefaultLocationString (Reporter reporter, ReportType messagetype, string location, Exception ex) | ||||||||||
Default delegate for assembly of the location string when reporting on consoles. For parameter descriptions, see ReportMessageDlg. More... | |||||||||||
static string | DefaultMessageString (Reporter reporter, ReportType messagetype, string basicmessage, Exception ex) | ||||||||||
Default delegate for message assembly of the message string when reporting on consoles. For parameter descriptions, see ReportMessageDlg. More... | |||||||||||
static string | DefaultReserveReportMessage (Reporter reporter, ReportType messagetype, string location, string message, Exception ex, Exception ex1) | ||||||||||
Default function function for assembling reserve error reporting message. This is put outside the DefaultReserveReportError() method such that the same assembly method can be used in different systems. The method is considered bulletproof.
| |||||||||||
static void | DefaultReserveReportError (Reporter reporter, ReportType messagetype, string location, string message, Exception ex, Exception ex1) | ||||||||||
Default function function for reserve error reporting (called if an exception is thrown in an error reporting function). Writes a report to the application'result standard console (if defined). More... | |||||||||||
static string | ErrorLocationString0 (Exception ex) | ||||||||||
Returns location string derived from ex, which includes information about the location where error occurred, specified by the source file name, function and line and column numbers. More... | |||||||||||
static string | ErrorLocationString0 (string location, Exception ex) | ||||||||||
Returns Error location string derived from ex, which includes information about location of error occurrence and is prepended by additional location information (such as class name) More... | |||||||||||
Public Attributes | |
ReportDelegate | ReportDlg = null |
Delegate that performs error reporting. It calls delegates ReportDlg to assemble error location information and ReportMessageDlg to assemble error message. Then it uses both to assemble the final decorated error message and launches it in its own way. More... | |
ReportLocationDelegate | ReportLocationDlg = null |
Delegate that assembles the error location string. More... | |
ReportMessageDelegate | ReportMessageDlg = null |
Delegate that assembles the eror message string. More... | |
ReserveReportErrorDelegate | ReserveReportErrorDlg = null |
Delegate that reports an error when the error reporting function throws an exception. Functions assigned to this delegate should really be BULLETPROOF. It is highly recommended to do reporting in small steps enclosed in try/catch blocks and especially to use the error reporting object very carefully (because it may not be initialized properly, which can also be the reason that the error reporting function crashes). It is higly recommended to first call the DefaultReserveReportError() within the function assigned to this delegate, or at least to use the DefaultReserveReportMessage() method for assembly of the message shown. More... | |
bool | DebugMode = false |
Indicates that reporting suitable for debugging mode should be performed. A standard flag that can be used by the delegate functions. More... | |
ReportDelegate | ReportDlgTextWriter = new ReportDelegate(DefaultReport_TextWriter) |
Delegate that performs reporting (actually logging) via text writer. More... | |
ReportLocationDelegate | ReportLocationDlgTextWriter = new ReportLocationDelegate(DefaultReportLocation_TextWriter) |
Delegate that assembles the location string for reporting via console form. More... | |
ReportMessageDelegate | ReportMessageDlgTextWriter = new ReportMessageDelegate(DefaultReportMessage_TextWriter) |
Delegate that assembles the message string for reporting via text writer. More... | |
Protected Member Functions | |
virtual void | SetDefaultReportDlg () |
Sets the error reporting delegate to the default value. The default delegate does not utilize the auxiliary object (and can be mixed with the delegates that do.) More... | |
virtual void | SetDefaultReportLocationDlg () |
Sets the error location assembling delegate to the default value. The default delegate does not utilize the auxiliary object (and can be mixed with the delegates that do.) More... | |
virtual void | SetDefaultReportMessageDlg () |
Sets the error message assembling delegate to the default value. The default delegate does not utilize the auxiliary object (and can be mixed with the delegates that do.) More... | |
virtual void | SetDefaultReserveReportErrorDlg () |
Sets the reserve error reporting delegate to the default value. The default delegate does not utilize the auxiliary object (and can be mixed with the delegates that do.) More... | |
virtual void | InitBegin () |
Initial part of initialization. Auxiliary object is not affected because default delegates do not utilize it. More... | |
virtual void | InitEnd () |
Finalizing part of initialization. Auxiliary object is not affected because default delegates do not utilize it. More... | |
void | SyncReportLevelWithTraceSwitch (TraceSwitch tswitch, ref ReportLevel level) |
Synchronizes the value of ReportLevel enumeration variable with the state of a TraceSwitch variable. Enumeration is synchronized according to the Level property of the switch. More... | |
void | SyncTraceSwitchWithReportLevel (ReportLevel level, TraceSwitch tswitch) |
Synchronizes the state of a TraceSwitch object with the value of the ReportLevel enumeration. More... | |
virtual void | ReserveReportError (ReportType messagetype, string location, string message, Exception ex, Exception ex1) |
Used to report errors within reporting functions. Designed to be bullet proof in order to ensure that improper behavior of the reporting system does not remain unnoticed. More... | |
virtual void | Report_TextWriter (ReportType messagetype, string location, string message, Exception ex) |
Launches a report via console form. Report is launched by using special delegates for this kind of reporting. If the corresponding delegates for error location and message are not specified then general delegates are used for this purporse, or location and message string are simple assembled by this function. More... | |
Static Protected Member Functions | |
static int | WriteMessage (Reporter reporter, string msg) |
Writes the message msg to all output streams and files registered with the reporter. More... | |
static void | DefaultReport_TextWriter (Reporter reporter, ReportType messagetype, string location, string message) |
Default delegate for launching reports (actually logging reports) via text writer. More... | |
static string | DefaultReportLocation_TextWriter (Reporter reporter, ReportType messagetype, string location, Exception ex) |
Delegate for assembling a location string for this kind of report. More... | |
static string | DefaultReportMessage_TextWriter (Reporter reporter, ReportType messagetype, string basicmessage, Exception ex) |
Delegate for assembling a report message for this kind of report. More... | |
Protected Attributes | |
bool | IsGlobal = false |
Indicates whwther the current reporter is used as a global reporter or not. This flag is set when the global reporter is initialized. More... | |
ReportLevel | _ReportingLevel = ReportLevel.Warning |
TraceSwitch | _ReportingSwitch = null |
object | _lockobj = new Object() |
Properties | |
static bool | GlobalInitialized [get] |
static Reporter | Global [get, protected set] |
Gets the global reporter object. This is typically used for configuring the global reporter. More... | |
virtual ReportLevel | ReportingLevel [get, set] |
Gets or sets level of output for reporting (console output, message boxes, etc.). More... | |
virtual ReportLevel | LoggingLevel [get, set] |
Gets or sets level of output for logging (writing to log files). More... | |
virtual ReportLevel | TracingLevel [get, set] |
Gets or sets trace level (for external trace systems). More... | |
bool | TreatError [get] |
Returns a boolean value indicating whether errors are treated by the reporter in its current state. More... | |
bool | TreatWarning [get] |
Returns a boolean value indicating whether warnings are treated by the reporter in its current state. More... | |
bool | TreatInfo [get] |
Returns a boolean value indicating whether info messages are treated by the reporter in its current state. More... | |
bool | TreatUndefined [get] |
Returns a boolean value indicating whether undefined messages with the lowest priority are treated by the reporter in its current state. More... | |
ReportLevel | Level [get, set] |
Gets the level with the lowesst priority (out of reporting, logging and tracing level), or sets all levels to the assigned level. More... | |
virtual bool | this[ReportLevel level] [get, set] |
Indexer that returns true if messages of a given level are treated by the reporter (either by the reporting, logging or tracing part, according to the corresponding level states), or false if not (i.e. if all the levels are set lover than the index). In the case of assignment, when true is assigned, all levels that are set lower than the are set to index. Assignment with false should be used only exteptionally; but in this case all levels that are set higher or equal than the index are set one level below. More... | |
TraceSwitch | ReportingSwitch [get, set] |
Gets or sets the TraceSwitch that is synchronized with ReportingLevel. IMPORTANT: State of the object obtained by get accessor must not be changed unless the object is assigned back by the set accessor. If one wants that this TraceSwitch assumes values specified by the configuration file, a corresponding Traceswitch must be created and assigned to this property (otherwise the TraceSwitch will be synchronized with the ReportingLevel, which will override its settings). More... | |
TraceSwitch | LoggingSwitch [get, set] |
Gets or sets the TraceSwitch that is synchronized with LoggingLevel. IMPORTANT: State of the object obtained by get accessor must not be changed unless the object is assigned back by the set accessor. If one wants that this TraceSwitch assumes values specified by the configuration file, a corresponding Traceswitch must be created and assigned to this property (otherwise the TraceSwitch will be synchronized with the LoggingLevel, which will override its settings). More... | |
TraceSwitch | TracingSwitch [get, set] |
Gets or sets the TraceSwitch that is synchronized with TracingLevel. IMPORTANT: State of the object obtained by get accessor must not be changed unless the object is assigned back by the set accessor. If one wants that this TraceSwitch assumes values specified by the configuration file, a corresponding Traceswitch must be created and assigned to this property (otherwise the TraceSwitch will be synchronized with the TracingLevel, which will override its settings). More... | |
bool | ThrowTestException [get, set] |
If true then the basic reporting function will throw an exception. This is intended predominantly for testing how the reporter behaves in case of internal errors. When the exception is thrown, the value is set back to false. If we want an exception to be thrown again then the value must be set to true once again. More... | |
object | Obj [get, set] |
Auxiliary object used by the delegates that perform error reporting. The object is used to provide additional information used in error reporting, or to provide objects that perform some actions in error reporting tasks, or both. It is left entirely to error reporting delegates to interpret the object'result contents. More... | |
virtual object | lockobj [get] |
Object used for locking. More... | |
bool | UseTextWriter [get, set] |
Gets or sets the flag specifying whether reporting using a text writer is performed or not. More... | |
![]() | |
ReportLevel | ReportingLevel [get, set] |
Gets or sets level of output for reporting (console output, message boxes, etc.). More... | |
ReportLevel | LoggingLevel [get, set] |
Gets or sets level of output for logging (writing to log files). More... | |
ReportLevel | TracingLevel [get, set] |
Gets or sets trace level (for external trace systems). More... | |
bool | TreatError [get] |
Returns a boolean value indicating whether errors are treated by the reporter in its current state. More... | |
bool | TreatWarning [get] |
Returns a boolean value indicating whether warnings are treated by the reporter in its current state. More... | |
bool | TreatInfo [get] |
Returns a boolean value indicating whether info messages are treated by the reporter in its current state. More... | |
bool | TreatUndefined [get] |
Returns a boolean value indicating whether undefined messages with the lowest priority are treated by the reporter in its current state. More... | |
ReportLevel | Level [get, set] |
Gets the level with the lowesst priority (out of reporting, logging and tracing level), or sets all levels to the assigned level. More... | |
bool | this[ReportLevel level] [get, set] |
Indexer that returns true if messages of a given level are treated by the reporter (either by the reporting, logging or tracing part, according to the corresponding level states), or false if not (i.e. if all the levels are set lover than the index). In the case of assignment, when true is assigned, all levels that are set lower than the are set to index. Assignment with false should be used only exteptionally; but in this case all levels that are set higher or equal than the index are set one level below. More... | |
TraceSwitch | ReportingSwitch [get, set] |
Gets or sets the TraceSwitch that is synchronized with ReportingLevel. IMPORTANT: State of the object obtained by get accessor must not be changed unless the object is assigned back by the set accessor. If one wants that this TraceSwitch assumes values specified by the configuration file, a corresponding Traceswitch must be created and assigned to this property (otherwise the TraceSwitch will be synchronized with the ReportingLevel, which will override its settings). More... | |
TraceSwitch | LoggingSwitch [get, set] |
Gets or sets the TraceSwitch that is synchronized with LoggingLevel. IMPORTANT: State of the object obtained by get accessor must not be changed unless the object is assigned back by the set accessor. If one wants that this TraceSwitch assumes values specified by the configuration file, a corresponding Traceswitch must be created and assigned to this property (otherwise the TraceSwitch will be synchronized with the LoggingLevel, which will override its settings). More... | |
TraceSwitch | TracingSwitch [get, set] |
Gets or sets the TraceSwitch that is synchronized with TracingLevel. IMPORTANT: State of the object obtained by get accessor must not be changed unless the object is assigned back by the set accessor. If one wants that this TraceSwitch assumes values specified by the configuration file, a corresponding Traceswitch must be created and assigned to this property (otherwise the TraceSwitch will be synchronized with the TracingLevel, which will override its settings). More... | |
object | Obj [get, set] |
Auxiliary object used by the delegates that perform error reporting. The object is used to provide additional information used in error reporting, or to provide objects that perform some actions in error reporting tasks, or both. It is left entirely to error reporting delegates to interpret the object'result contents. More... | |
object | lockobj [get] |
Object used for locking. More... | |
Private Member Functions | |
bool | SetWriter (TextWriter writer) |
Sets the text writer to which reporting is also performed. More... | |
bool | SetWriter (Stream stream) |
Creates a TextWriter upon the stream and sets it as the text writer to which reporting is also performed. More... | |
bool | SetWriter (string filename) |
Creates a TextWriter upon a file and sets it as the text writer to which reporting is also performed. More... | |
bool | SetWriter (string filename, bool overwrite) |
Creates a TextWriter upon a file and sets it as the text writer to which reporting is also performed. More... | |
Static Private Member Functions | |
static void | Test () |
Private Attributes | |
ReportLevel | _LoggingLevel = ReportLevel.Warning |
ReportLevel | _TracingLevel = ReportLevel.Info |
TraceSwitch | _LoggingSwitch = null |
TraceSwitch | _TracingSwitch = null |
bool | _ThrowTestException = false |
object | _obj = null |
bool | _UseTextWriter = false |
List< TextWriter > | Writers = new List<TextWriter>() |
List< String > | FileNames = new List<String>() |
TextWriter | Writer = null |
bool | DisposeWriter = false |
Static Private Attributes | |
static Reporter | _Global = null |
static bool | _GlobalInitialized = false |
Base IG class for reporting, tracing and logging; provides a global reporter and a basis for creation of local reporters. This class is identical to the IGLib class (copied directly). IN EFA, refer to the derived class Reporter!
|
inline |
Constructor. Initializes all error reporting delegates to default values and sets auxliary object to null. Auxiliary object Obj is set to null.
|
inline |
Constructor. Initializes the error reporter by the specified auxiliary object and delegates used to perform error reporting tasks. Delegates that are not specified are set to default values.
obj | Auxiliary object that will be passed to error reporting delegates when called in local methods. |
reportdelegate | Delegates that is called to launc an error report. Methods of this class will pass to this class the auxiliary object, location strings assembled by the location assembling delegate, and error message string assembled by the error message delegate. |
locationdelegate | Delegate that is called to assemble the error location string. The Auxiliary object this.Obj will be internally passed to this delegate any time it is called. |
messagedelegate | Delegate that is called to assemble the error message (without decorations). The Auxiliary object this.Obj will be internally passed to this delegate any time it is called. |
reservereportdelegate | Delegate that is called to report exceptions that occur within error reporting methods. In particular, this must ne as bullet proof as possible. |
|
inline |
Constructor. Initializes the error reporter by the specified auxiliary object and delegates used to perform error reporting tasks. Reserve error reporting delegate is initialized to a default value. Delegates that are not specified are set to default values.
|
inline |
Constructor. Initializes the error reporter by the specified auxiliary object and the delegate to perform error reporting tasks. Reserve error reporting delegate is initialized to a default value. Delegates for assembling the error location string and error message string are set to their default values, which are adapted to console-like eror reporting systems.
|
inline |
Constructor. Initializes the error reporter by the specified auxiliary object and delegates used to perform error reporting tasks. Delegates for assembling the error locatin and error message string are set to their default values, which are adapted to console-like eror reporting systems.
obj | Auxiliary object that will be passed to error reporting delegates when called in local methods. |
reportdelegate | Delegates that is called to launc an error report. Methods of this class will pass to this class the auxiliary object, location strings assembled by the location assembling delegate, and error message string assembled by the error message delegate. |
reservereportdelegate | Delegate that is called to report exceptions that occur within error reporting methods. In particular, this must ne as bullet proof as possible. |
|
inlineprotectedvirtual |
Sets the error reporting delegate to the default value. The default delegate does not utilize the auxiliary object (and can be mixed with the delegates that do.)
References IG.Lib.Old.ReportDelegate().
|
inlineprotectedvirtual |
Sets the error location assembling delegate to the default value. The default delegate does not utilize the auxiliary object (and can be mixed with the delegates that do.)
References IG.Lib.Old.ReportLocationDelegate().
|
inlineprotectedvirtual |
Sets the error message assembling delegate to the default value. The default delegate does not utilize the auxiliary object (and can be mixed with the delegates that do.)
References IG.Lib.Old.ReportMessageDelegate().
|
inlineprotectedvirtual |
Sets the reserve error reporting delegate to the default value. The default delegate does not utilize the auxiliary object (and can be mixed with the delegates that do.)
References IG.Lib.Old.ReserveReportErrorDelegate().
|
inlineprotectedvirtual |
Initial part of initialization. Auxiliary object is not affected because default delegates do not utilize it.
|
inlineprotectedvirtual |
Finalizing part of initialization. Auxiliary object is not affected because default delegates do not utilize it.
|
inline |
Initializes the error reporter by the specified auxiliary object and delegates used to perform error reporting tasks. Delegates that are not specified are set to default values.
obj | Auxiliary object that will be passed to error reporting delegates when called in local methods. |
reportdelegate | Delegates that is called to launc an error report. Methods of this class will pass to this class the auxiliary object, location strings assembled by the location assembling delegate, and error message string assembled by the error message delegate. |
locationdelegate | Delegate that is called to assemble the error location string. The Auxiliary object this.Obj will be internally passed to this delegate any time it is called. |
messagedelegate | Delegate that is called to assemble the error message (without decorations). The Auxiliary object this.Obj will be internally passed to this delegate any time it is called. |
reservereportdelegate | Delegate that is called to report exceptions that occur within error reporting methods. In particular, this must ne as bullet proof as possible. |
Implements IG.Lib.Old.IReporter.
|
inline |
Initializes all error reporting delegates to default values and sets auxliary object to null. Auxiliary object Obj is set to null.
Implements IG.Lib.Old.IReporter.
|
inline |
Initializes the error reporter by the specified auxiliary object and delegates used to perform error reporting tasks. Reserve error reporting delegate is initialized to a default value. Delegates that are not specified are set to default values.
Implements IG.Lib.Old.IReporter.
|
inline |
Initializes the error reporter by the specified auxiliary object and the delegate to perform error reporting tasks. Reserve error reporting delegate is initialized to a default value. Delegates for assembling the error location string and error message string are set to their default values, which are adapted to console-like eror reporting systems.
Implements IG.Lib.Old.IReporter.
|
inline |
Initializes the error reporter by the specified auxiliary object and delegates used to perform error reporting tasks. Delegates for assembling the error locatin and error message string are set to their default values, which are adapted to console-like eror reporting systems.
obj | Auxiliary object that will be passed to error reporting delegates when called in local methods. |
reportdelegate | Delegates that is called to launc an error report. Methods of this class will pass to this class the auxiliary object, location strings assembled by the location assembling delegate, and error message string assembled by the error message delegate. |
reservereportdelegate | Delegate that is called to report exceptions that occur within error reporting methods. In particular, this must ne as bullet proof as possible. |
Implements IG.Lib.Old.IReporter.
|
inlinevirtual |
Resets the various kinds of reporting levels to default values.
Implements IG.Lib.Old.IReporter.
|
inlinestatic |
Returns true if the report of a given type will be launched at the given reporting level, and false if not.
reptype | Type of the report for which information is returned. |
replevel | True if reports of the specific type are launched, false if not. |
|
inline |
Returns true if the report of a given type should be shown by user interface (according to ReportingLevel), and false if not.
reptype | Type of the report for which information is returned. |
|
inline |
Returns true if the report of a given type should be logged in log files (according to ReportingLevel), and false if not.
reptype | Type of the report for which information is returned. |
|
inline |
Returns true if the report of a given type should traced (according to ReportingLevel), and false if not.
reptype | Type of the report for which information is returned. |
|
inlinevirtual |
Returns the System.Diagnostics.EventLogEntryType value corresponding to the given ReportType. Remark: FailureAudit and SuccessAudit can not be generated because they don't have representation in ReportType.
level | ReportType value to be converted. |
Implements IG.Lib.Old.IReporter.
|
inlinevirtual |
Returns the ReportType value corresponding to the given System.Diagnostics.EventLogEntryType. Remark: FailureAudit and SuccessAudit do not have representation in ReportType and are mapped to Error and Warning, respectively.
level | EventLogEntryType value to be converted. |
Implements IG.Lib.Old.IReporter.
|
inlinevirtual |
Returns the System.Diagnostics.TraceLevel value corresponding to the given ReportLevel.
level | ReportLevel value to be converted. |
Implements IG.Lib.Old.IReporter.
|
inlinevirtual |
Returns the ReportLevel value corresponding to the given System.Diagnostics.TraceLevel.
level | TraceLevel value to be converted. |
Implements IG.Lib.Old.IReporter.
|
inlineprotected |
Synchronizes the value of ReportLevel enumeration variable with the state of a TraceSwitch variable. Enumeration is synchronized according to the Level property of the switch.
tswitch | A trace switch that the ReportLevel enumeration variable will be synchronized with. If it is null or it contains a level that can not be represented by the ReportLevel enumeration then nothing happens. |
level | The ReportLevel variable that is synchronized; declared as ref |
|
inlineprotected |
Synchronizes the state of a TraceSwitch object with the value of the ReportLevel enumeration.
level | Value of the ReportLevel enumeration that TraceSwitch will be synchronized with |
tswitch | TraceSwitch taht is synchronized. |
|
inlineprotectedvirtual |
Used to report errors within reporting functions. Designed to be bullet proof in order to ensure that improper behavior of the reporting system does not remain unnoticed.
messagetype | |
location | |
message | |
ex | |
ex1 |
|
inlinevirtual |
Basic reporting method (overloaded). Launches an error report, a warning report or s kind of report/message. Supplemental data (such as objects necessary to launch visualize the report or operation typeflags) are obtained from the class' instance.
messagetype | The type of the report (e.g. Error, Warning, etc.). |
location | User-provided description of error location. |
message | User-provided description of error. |
ex | Exception thrown when error occurred. |
Implements IG.Lib.Old.IReporter.
|
inline |
Launches a report. Predominantly for error and warning reports.
messagetype | Level of the message (Error, Warnind, etc.). |
message | User-provided description of error. |
ex | Exception that is the cause for launching the report (and from which additional information is extracted). |
Implements IG.Lib.Old.IReporter.
|
inline |
Launches a report. Predominantly for error and warning reports.
messagetype | Level of the message (Error, Warnind, etc.). |
ex | Exception that is the cause for launching the report (and from which additional information is extracted). |
location | User-provided description of error location. |
Implements IG.Lib.Old.IReporter.
|
inline |
Launches a report. Predominantly for error and warning reports.
messagetype | Level of the message (Error, Warnind, etc.). |
ex | Exception that is the cause for launching the report (and from which additional information is extracted). |
Implements IG.Lib.Old.IReporter.
|
inline |
Launches a report.
messagetype | Level of the message (Error, Warnind, etc.). |
location | User provided description of the location where report was triggered. |
message | User provided message included in the report. |
Implements IG.Lib.Old.IReporter.
|
inline |
Launches a report.
messagetype | Level of the message (Error, Warnind, etc.). |
message | User provided message included in the report. |
Implements IG.Lib.Old.IReporter.
|
inline |
Basic error reporting method (overloaded). Supplemental data (such as objects necessary to launch visualize the report or operation typeflags) are obtained from the class' instance.
location | User-provided description of error location. |
message | User-provided description of error. |
ex | Exception thrown when error occurred. |
Implements IG.Lib.Old.IReporter.
|
inline |
Launches an error report.
message | User-provided description of error. |
ex | Exception that is the cause for launching the report (and from which additional information is extracted). |
Implements IG.Lib.Old.IReporter.
|
inline |
Launches an error report.
ex | Exception that is the cause for launching the report (and from which additional information is extracted). |
location | User-provided description of error location. |
Implements IG.Lib.Old.IReporter.
|
inline |
Launches an error report. Predominantly for error and warning reports.
ex | Exception that is the cause for launching the report (and from which additional information is extracted). |
Implements IG.Lib.Old.IReporter.
|
inline |
Launches an error report.
location | User provided description of the location where report was triggered. |
message | User provided message included in the report. |
Implements IG.Lib.Old.IReporter.
|
inline |
Launches an error report.
message | User provided message included in the report. |
Implements IG.Lib.Old.IReporter.
|
inline |
Basic warning reporting method (overloaded). Supplemental data (such as objects necessary to launch visualize the report or operation typeflags) are obtained from the class' instance.
location | User-provided description of error location. |
message | User-provided description of error. |
ex | Exception thrown when error occurred. |
Implements IG.Lib.Old.IReporter.
|
inline |
Launches a warning report.
message | User-provided description of error. |
ex | Exception that is the cause for launching the report (and from which additional information is extracted). |
Implements IG.Lib.Old.IReporter.
|
inline |
Launches a warning report.
ex | Exception that is the cause for launching the report (and from which additional information is extracted). |
location | User-provided description of error location. |
Implements IG.Lib.Old.IReporter.
|
inline |
Launches a warning report. Predominantly for error and warning reports.
ex | Exception that is the cause for launching the report (and from which additional information is extracted). |
Implements IG.Lib.Old.IReporter.
|
inline |
Launches a warning report.
location | User provided description of the location where report was triggered. |
message | User provided message included in the report. |
Implements IG.Lib.Old.IReporter.
|
inline |
Launches a warning report.
message | User provided message included in the report. |
Implements IG.Lib.Old.IReporter.
|
inline |
Launches an info.
ex | Exception that is the cause for launching the report (and from which additional information is extracted). |
Implements IG.Lib.Old.IReporter.
|
inline |
Launches an info.
location | User provided description of the location where report was triggered. |
message | User provided message included in the report. |
Implements IG.Lib.Old.IReporter.
|
inline |
Launches an info.
message | User provided message included in the report. |
Implements IG.Lib.Old.IReporter.
|
inlineprivate |
Sets the text writer to which reporting is also performed.
writer | Writer to which reporting will be performed. |
|
inlineprivate |
Creates a TextWriter upon the stream and sets it as the text writer to which reporting is also performed.
writer | Stream to which reporting will be performed. |
|
inlineprivate |
Creates a TextWriter upon a file and sets it as the text writer to which reporting is also performed.
writer | Stream to which reporting will be performed. |
|
inlineprivate |
Creates a TextWriter upon a file and sets it as the text writer to which reporting is also performed.
writer | Stream to which reporting will be performed. |
overwrite | If true then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file. |
|
inlinestaticprotected |
Writes the message msg to all output streams and files registered with the reporter.
reporter | Reporter used for reporting, containing information about output streams and files. |
msg | String to be written to output streams and files. |
References IG.Lib.Old.Reporter.FileNames, IG.Lib.Old.Reporter.Writer, and IG.Lib.Old.Reporter.Writers.
|
inlinestaticprotected |
Default delegate for launching reports (actually logging reports) via text writer.
reporter | Reporter object where additional information can be found. |
messagetype | Type of the report(Error, Warning, Info...). |
location | Short string desctribing location where report was triggered. |
message | Message of the report. |
|
inlinestaticprotected |
Delegate for assembling a location string for this kind of report.
reporter | Reporter object where additional information can be found. |
messagetype | Type of the report(Error, Warning, Info...). |
location | User provided location string. |
ex | Exception that triggered reporting. |
|
inlinestaticprotected |
Delegate for assembling a report message for this kind of report.
reporter | Reporter object where additional information can be found. |
messagetype | Type of the report(Error, Warning, Info...). |
basicmessage | User provided message string. |
ex | Exception that triggered reporting. |
|
inlineprotectedvirtual |
Launches a report via console form. Report is launched by using special delegates for this kind of reporting. If the corresponding delegates for error location and message are not specified then general delegates are used for this purporse, or location and message string are simple assembled by this function.
messagetype | Type of the report(Error, Warning, Info...). |
location | User provided location string. |
message | User provided message string. |
ex | Exception that triggered reporting. |
|
inlinestatic |
Auxiliary method that composes the complete message, including decoration, for reports launched in a message box.
reporter | Reporter object used for reporting. |
messagetype | Level of the message that is reported (Error, Warning, ...) |
errorlocation | User description of location that caused the report. |
errormessage | User defined message. |
|
inlinestatic |
Auxiliary method that composes the complete message, including decoration, for reports launched in consoles.
reporter | Reporter object used for reporting. |
messagetype | Level of the message that is reported (Error, Warning, ...) |
errorlocation | User description of location that caused the report. |
errormessage | User defined message. |
|
inlinestatic |
Auxiliary method that composes the complete message, including decoration with a TIMESTAMP, for reports launched in consoles.
reporter | Reporter object used for reporting. |
messagetype | Level of the message that is reported (Error, Warning, ...) |
errorlocation | User description of location that caused the report. |
errormessage | User defined message. |
|
inlinestatic |
Base method for DefaultReportStringConsole and DefaultReportStringConsoleTimeStamp.
reporter | Reporter object used for reporting. |
messagetype | Level of the message that is reported (Error, Warning, ...) |
errorlocation | User description of location that caused the report. |
errormessage | User defined message. |
timestamp | Specifies whether to include a time stamp in the message. |
|
inlinestatic |
Default delegate for reporting. For parameter descriptions, see ReportDlg.
|
inlinestatic |
Default delegate for assembly of the location string when reporting on consoles. For parameter descriptions, see ReportMessageDlg.
|
inlinestatic |
Default delegate for message assembly of the message string when reporting on consoles. For parameter descriptions, see ReportMessageDlg.
|
inlinestatic |
Default function function for assembling reserve error reporting message. This is put outside the DefaultReserveReportError() method such that the same assembly method can be used in different systems. The method is considered bulletproof.
messagetype | Level of the message (Error, Warning,Info, etc.) |
location | Location string as passed to the error reporting function that has thrown an exception. |
message | Error message string as passed to the error reporting function that has thrown an exception. |
ex | Original exception that was being reported when the error reporting function threw an exception. |
ex1 | Exception thrown by the error reporting function. |
|
inlinestatic |
Default function function for reserve error reporting (called if an exception is thrown in an error reporting function). Writes a report to the application'result standard console (if defined).
reporter | Reporter object whre the method can get additional information. |
messagetype | Level of the message (Error, Warning,Info, etc.) |
location | Location string as passed to the error reporting function that has thrown an exception. |
message | Error message string as passed to the error reporting function that has thrown an exception. |
ex | Original exception that was being reported when the error reporting function threw an exception. |
ex1 | Exception thrown by the error reporting function. |
|
inlinestatic |
Returns location string derived from ex, which includes information about the location where error occurred, specified by the source file name, function and line and column numbers.
ex |
|
inlinestatic |
Returns Error location string derived from ex, which includes information about location of error occurrence and is prepended by additional location information (such as class name)
location | |
ex |
|
inlinestaticprivate |
|
staticprivate |
|
staticprivate |
|
protected |
Indicates whwther the current reporter is used as a global reporter or not. This flag is set when the global reporter is initialized.
ReportDelegate IG.Lib.Old.Reporter.ReportDlg = null |
Delegate that performs error reporting. It calls delegates ReportDlg to assemble error location information and ReportMessageDlg to assemble error message. Then it uses both to assemble the final decorated error message and launches it in its own way.
ReportLocationDelegate IG.Lib.Old.Reporter.ReportLocationDlg = null |
Delegate that assembles the error location string.
ReportMessageDelegate IG.Lib.Old.Reporter.ReportMessageDlg = null |
Delegate that assembles the eror message string.
ReserveReportErrorDelegate IG.Lib.Old.Reporter.ReserveReportErrorDlg = null |
Delegate that reports an error when the error reporting function throws an exception. Functions assigned to this delegate should really be BULLETPROOF. It is highly recommended to do reporting in small steps enclosed in try/catch blocks and especially to use the error reporting object very carefully (because it may not be initialized properly, which can also be the reason that the error reporting function crashes). It is higly recommended to first call the DefaultReserveReportError() within the function assigned to this delegate, or at least to use the DefaultReserveReportMessage() method for assembly of the message shown.
bool IG.Lib.Old.Reporter.DebugMode = false |
Indicates that reporting suitable for debugging mode should be performed. A standard flag that can be used by the delegate functions.
|
protected |
|
private |
|
private |
|
protected |
|
private |
|
private |
|
private |
|
private |
|
protected |
|
private |
|
private |
Referenced by IG.Lib.Old.Reporter.WriteMessage().
|
private |
Referenced by IG.Lib.Old.Reporter.WriteMessage().
|
private |
Referenced by IG.Lib.Old.Reporter.WriteMessage().
|
private |
ReportDelegate IG.Lib.Old.Reporter.ReportDlgTextWriter = new ReportDelegate(DefaultReport_TextWriter) |
Delegate that performs reporting (actually logging) via text writer.
ReportLocationDelegate IG.Lib.Old.Reporter.ReportLocationDlgTextWriter = new ReportLocationDelegate(DefaultReportLocation_TextWriter) |
Delegate that assembles the location string for reporting via console form.
ReportMessageDelegate IG.Lib.Old.Reporter.ReportMessageDlgTextWriter = new ReportMessageDelegate(DefaultReportMessage_TextWriter) |
Delegate that assembles the message string for reporting via text writer.
|
staticget |
|
staticgetprotected set |
Gets the global reporter object. This is typically used for configuring the global reporter.
|
getset |
Gets or sets level of output for reporting (console output, message boxes, etc.).
|
getset |
Gets or sets level of output for logging (writing to log files).
|
getset |
Gets or sets trace level (for external trace systems).
|
get |
Returns a boolean value indicating whether errors are treated by the reporter in its current state.
|
get |
Returns a boolean value indicating whether warnings are treated by the reporter in its current state.
|
get |
Returns a boolean value indicating whether info messages are treated by the reporter in its current state.
|
get |
Returns a boolean value indicating whether undefined messages with the lowest priority are treated by the reporter in its current state.
|
getset |
Gets the level with the lowesst priority (out of reporting, logging and tracing level), or sets all levels to the assigned level.
|
getset |
Indexer that returns true if messages of a given level are treated by the reporter (either by the reporting, logging or tracing part, according to the corresponding level states), or false if not (i.e. if all the levels are set lover than the index). In the case of assignment, when true is assigned, all levels that are set lower than the are set to index. Assignment with false should be used only exteptionally; but in this case all levels that are set higher or equal than the index are set one level below.
level | Level for which we are interested whether it is treated. |
|
getset |
Gets or sets the TraceSwitch that is synchronized with ReportingLevel. IMPORTANT: State of the object obtained by get accessor must not be changed unless the object is assigned back by the set accessor. If one wants that this TraceSwitch assumes values specified by the configuration file, a corresponding Traceswitch must be created and assigned to this property (otherwise the TraceSwitch will be synchronized with the ReportingLevel, which will override its settings).
|
getset |
Gets or sets the TraceSwitch that is synchronized with LoggingLevel. IMPORTANT: State of the object obtained by get accessor must not be changed unless the object is assigned back by the set accessor. If one wants that this TraceSwitch assumes values specified by the configuration file, a corresponding Traceswitch must be created and assigned to this property (otherwise the TraceSwitch will be synchronized with the LoggingLevel, which will override its settings).
|
getset |
Gets or sets the TraceSwitch that is synchronized with TracingLevel. IMPORTANT: State of the object obtained by get accessor must not be changed unless the object is assigned back by the set accessor. If one wants that this TraceSwitch assumes values specified by the configuration file, a corresponding Traceswitch must be created and assigned to this property (otherwise the TraceSwitch will be synchronized with the TracingLevel, which will override its settings).
|
getset |
If true then the basic reporting function will throw an exception. This is intended predominantly for testing how the reporter behaves in case of internal errors. When the exception is thrown, the value is set back to false. If we want an exception to be thrown again then the value must be set to true once again.
|
getset |
Auxiliary object used by the delegates that perform error reporting. The object is used to provide additional information used in error reporting, or to provide objects that perform some actions in error reporting tasks, or both. It is left entirely to error reporting delegates to interpret the object'result contents.
|
get |
Object used for locking.
|
getset |
Gets or sets the flag specifying whether reporting using a text writer is performed or not.