|
Wasatch.NET 2.4.14
.NET application driver for Wasatch Photonics spectrometers
|
Singleton used throughout WasatchNET for logging and debugging. More...
Public Member Functions | |
| void | close () |
| void | debug (string fmt, params Object[] obj) |
| log a debug message | |
| bool | debugEnabled () |
| Whether debugging is enabled. | |
| bool | error (string fmt, params Object[] obj) |
| log an error message | |
| List< string > | getErrors () |
| string | getLastError () |
| peel-off the most recent error | |
| bool | hasError () |
| whether any recent errors have occurred | |
| void | header (string fmt, params Object[] obj) |
| void | hexdump (byte[] buf, string prefix="") |
| void | info (string fmt, params Object[] obj) |
| log an info message | |
| void | logString (LogLevel lvl, string msg) |
| log a string at arbitrary level w/o arguments | |
| void | save (string pathname) |
| write TextBox contents to a text file | |
| void | setPathname (string path) |
| If you'd like log messages written to a text file, specify the path here. | |
| void | setTextBox (TextBox tb) |
| If you're developing in WinForms, pass a TextBook into the Logger for instant visualization! | |
| void | debug (string fmt, params Object[] obj) |
| log a debug message | |
| bool | debugEnabled () |
| Whether debugging is enabled. | |
| bool | error (string fmt, params Object[] obj) |
| log an error message | |
| string | getLastError () |
| peel-off the most recent error | |
| bool | hasError () |
| whether any recent errors have occurred | |
| void | hexdump (byte[] buf, string prefix="") |
| void | info (string fmt, params Object[] obj) |
| log an info message | |
| void | logString (LogLevel lvl, string msg) |
| log a string at arbitrary level w/o arguments | |
| void | save (string pathname) |
| write TextBox contents to a text file | |
| void | setPathname (string path) |
| If you'd like log messages written to a text file, specify the path here. | |
| void | setTextBox (TextBox tb) |
| If you're developing in WinForms, pass a TextBook into the Logger for instant visualization! | |
Static Public Member Functions | |
| static Logger | getInstance () |
Properties | |
| LogLevel | level [get, set] |
Properties inherited from WasatchNET.ILogger | |
| LogLevel | level [get, set] |
Private Member Functions | |
| string | getTimestamp () |
| void | log (LogLevel lvl, string fmt, params Object[] obj) |
| Logger () | |
Private Attributes | |
| LogLevel | _level = LogLevel.INFO |
| int | errorCount |
| LinkedList< string > | errors = new LinkedList<string>() |
| StreamWriter | outfile |
| TextBox | textBox = null |
Static Private Attributes | |
| static readonly Logger | instance = new Logger() |
| const int | MAX_ERRORS = 100 |
Singleton used throughout WasatchNET for logging and debugging.
Note that if running applications using Wasatch.NET from within Visual Studio, log messages should be visible at the Console Output, even if no TextBox or Path has been set.
|
inlineprivate |
|
inline |
|
inline |
log a debug message
| fmt | see String.Format() fmt |
| obj | see String.Format() args |
Implements WasatchNET.ILogger.
|
inline |
|
inline |
log an error message
| fmt | see String.Format() fmt |
| obj | see String.Format() args |
Implements WasatchNET.ILogger.
|
inline |
|
inlinestatic |
|
inline |
peel-off the most recent error
other errors will remain in the "recent" queue; this does not necessary clear hasError()
Implements WasatchNET.ILogger.
|
inlineprivate |
|
inline |
whether any recent errors have occurred
Implements WasatchNET.ILogger.
|
inline |
|
inline |
Implements WasatchNET.ILogger.
|
inline |
log an info message
| fmt | see String.Format() fmt |
| obj | see String.Format() args |
Implements WasatchNET.ILogger.
|
inlineprivate |
|
inline |
log a string at arbitrary level w/o arguments
| lvl | a valid LogLevel |
| msg | message |
Provided for client languages that have difficulty passing an empty params Object[] array
Implements WasatchNET.ILogger.
|
inline |
write TextBox contents to a text file
| pathname | path to create |
only works if setTextBox() has been called; otherwise, use setPathname()
Implements WasatchNET.ILogger.
|
inline |
If you'd like log messages written to a text file, specify the path here.
Make sure the directory exists and is writable.
| path | output path (e.g. "\\tmp\\WasatchNET.log") |
Implements WasatchNET.ILogger.
|
inline |
If you're developing in WinForms, pass a TextBook into the Logger for instant visualization!
| tb | the TextBox control where you would like log messages to appear |
Implements WasatchNET.ILogger.
|
private |
|
private |
|
private |
|
staticprivate |
|
private |
|
private |
|
getset |
Implements WasatchNET.ILogger.