A simple logger used to record important events and exceptions.
More...
|
static void | Init () |
| Initializes the log using the file defined in the Filename property.
|
static void | AfterInit () |
| Finalize initialization. Call during startup. If logging will be used, call after Init(). Otherwise call at any convenient point during startup.
|
static void | Finish () |
| Finishes the logger.
Closes the log file.
|
static void | Write (string Message) |
| Writes the specified message to the logfile.
|
static void | Error (string Message) |
| Writes an error message to the log.
|
static void | Once (string key, string message) |
| One-time message logging. Logs a message, identified by a string key, only the first time the key is used. This is useful for logging information that's always stable throughout a session, and.
|
static void | Warning (string Message) |
| Writes a warning message to the log.
|
static void | Exception (string Message, Exception E=null) |
| Writes a exception message to the log.
|
static void | Exception (Exception E) |
| Writes a exception to the log.
|
static void | Instrumentation (string key, string Message) |
| Writes the specified instrumentation debug message to the log file, ONLY IF the provided key is one of the keys specified in the <Instrumentation> element in the GlobalConfig.xml file. If the key isn't listed there, the message is suppressed. This can be used for debugging messages that you don't want to include in the log EXCEPT during development work, or when helping a user troubleshoot a problem that requires visibility into low-level details. This is especially useful for messages that are generated many times during a session, such as messages generated every time an output port is triggered.
|
static void | Debug (string Message) |
| Writes the specified debug message to the log file.
|
A simple logger used to record important events and exceptions.
◆ AfterInit()
void DirectOutput.Log.AfterInit |
( |
| ) |
|
|
static |
Finalize initialization. Call during startup. If logging will be used, call after Init(). Otherwise call at any convenient point during startup.
◆ Debug()
void DirectOutput.Log.Debug |
( |
string | Message | ) |
|
|
static |
Writes the specified debug message to the log file.
- Parameters
-
Message | The message to be written to the log file. |
◆ Error()
void DirectOutput.Log.Error |
( |
string | Message | ) |
|
|
static |
Writes an error message to the log.
- Parameters
-
◆ Exception() [1/2]
void DirectOutput.Log.Exception |
( |
Exception | E | ) |
|
|
static |
Writes a exception to the log.
- Parameters
-
E | The Exception to be logged. |
◆ Exception() [2/2]
void DirectOutput.Log.Exception |
( |
string | Message, |
|
|
Exception | E = null ) |
|
static |
Writes a exception message to the log.
- Parameters
-
Message | The message. |
E | The Exception to be logged. |
◆ Finish()
void DirectOutput.Log.Finish |
( |
| ) |
|
|
static |
Finishes the logger.
Closes the log file.
◆ Init()
void DirectOutput.Log.Init |
( |
| ) |
|
|
static |
Initializes the log using the file defined in the Filename property.
◆ Instrumentation()
void DirectOutput.Log.Instrumentation |
( |
string | key, |
|
|
string | Message ) |
|
static |
Writes the specified instrumentation debug message to the log file, ONLY IF the provided key is one of the keys specified in the <Instrumentation> element in the GlobalConfig.xml file. If the key isn't listed there, the message is suppressed. This can be used for debugging messages that you don't want to include in the log EXCEPT during development work, or when helping a user troubleshoot a problem that requires visibility into low-level details. This is especially useful for messages that are generated many times during a session, such as messages generated every time an output port is triggered.
The <Instrumentation> element in the config file can also be set to a single asterisk (*) to enable ALL of the instrumentation keys. That means that you shouldn't use "*" as an actual message key, of course.
- Parameters
-
key | The instrumentation key. This is an arbitrary string identifying the instrumentation source, to determine whether or not to include the message in the log. |
Message | The message to be written to the log file. |
◆ Once()
void DirectOutput.Log.Once |
( |
string | key, |
|
|
string | message ) |
|
static |
One-time message logging. Logs a message, identified by a string key, only the first time the key is used. This is useful for logging information that's always stable throughout a session, and.
thus would just repeat the same information over and over if it were repeated every time the code path was taken. After a message is logged under a given key, subsequent calls with the same key will do nothing, suppressing the additional redundant copies of the message. Note that the message itself isn't considered when deciding whether or not the repeat should be suppressed - the suppression is based purely on the key. Use this only when you're reasonably certain that the logged information really is unchanging throughout any given session.
- Parameters
-
key | An arbitrary caller-defined string uniquely identifying the message |
message | The message text to log |
◆ Warning()
void DirectOutput.Log.Warning |
( |
string | Message | ) |
|
|
static |
Writes a warning message to the log.
- Parameters
-
◆ Write()
void DirectOutput.Log.Write |
( |
string | Message | ) |
|
|
static |
Writes the specified message to the logfile.
- Parameters
-
◆ OneTimeLogMessages
HashSet<string> DirectOutput.Log.OneTimeLogMessages = new HashSet<string>() |
|
staticprotected |
◆ Filename
string DirectOutput.Log.Filename |
|
staticgetset |
Gets or sets the filename for the log.
The filename.
◆ Instrumentations
string DirectOutput.Log.Instrumentations |
|
staticset |
The documentation for this class was generated from the following file:
- D:/a/DirectOutput/DirectOutput/DirectOutput/Log.cs