The TLogging class provides general logging functionality. Logging output can currently go to the Console, to a file or to both at the same time.
More...
|
static void | ResetStaticVariables () |
| reset the static variables for each Web Request call. More...
|
|
static void | SendConsoleOutputToString (TLogNewMessageCallback ANewMessageCallback) |
| Call this method on Windows Forms apps to send the 'console' output to a dynamic string More...
|
|
static String | GetLogFileName () |
| returns the name of the current log file More...
|
|
static void | SetContext (String context) |
| Set the context of the program situation. It is displayed in the next log messages. More...
|
|
static void | SetStatusBarProcedure (TStatusCallbackProcedure callbackfn) |
| This sets the procedure that is called with the text as an parameter. It can be used to update a status bar. More...
|
|
static String | GetConsoleLog () |
| Gets the current console log text. Throws an exception if the console text is being written to a console. You should call SendConsoleOutputToString to send output to this string More...
|
|
static void | Log (string Text, TStatusCallbackProcedure ACustomStatusCallbackProcedure=null) |
| Logs a message. Output goes to both Screen and Logfile and - if a callback has been set up with SetStatusBarProcedure or gets passed in with ACustomStatusCallbackProcedure - to a Status Bar of a Form, too. More...
|
|
static void | LogAtLevel (Int32 Level, string Text) |
| Log if level is this high More...
|
|
static void | LogAtLevel (Int32 ALevel, string AText, TLoggingType ALoggingType) |
| Log if level is this high. Output destination can be selected with the Loggingtype flag. More...
|
|
static void | Log (string Text, TLoggingType ALoggingType, TStatusCallbackProcedure ACustomStatusCallbackProcedure=null) |
| Logs a message. Output destination can be selected with the Loggingtype flag. More...
|
|
static String | StackTraceToText (StackTrace st) |
|
static void | LogStackTrace (TLoggingType ALoggingtype=TLoggingType.ToConsole|TLoggingType.ToLogfile) |
| log the current stack trace More...
|
|
static void | LogException (Exception AEx, String AMethodSignature="") |
| Logs a number of messages in one go. Output goes to both Screen and Logfile. More...
|
|
static void | Log (ArrayList aList, bool isException) |
| Logs a number of messages in one go. Output goes to both Screen and Logfile. More...
|
|
static void | Log (ArrayList aList, bool isException, TLoggingType Loggingtype) |
| Logs a number of messages in one go. Output destination can be selected with the Loggingtype flag. More...
|
|
static void | LogDataTable (DataTable DT) |
| Writes the contents of a DataTable to the log file. Useful to have this available for debugging. More...
|
|
|
static int | DL [get] |
| DL is a abbreviated synonym for DebugLevel (more convenient) More...
|
|
static bool | NoLoggingToConsoleError [get, set] |
| No logging of messages to Console.Error? Set this to true if the PetraServer runs as a Windows Service to prevent Bug #5846! More...
|
|
static string | UserNamePrefix [get, set] |
| property for the prefix that describes the More...
|
|
The TLogging class provides general logging functionality. Logging output can currently go to the Console, to a file or to both at the same time.
◆ TLogging() [1/2]
Ict.Common.TLogging.TLogging |
( |
| ) |
|
|
inline |
Creates a Console-only logger.
◆ TLogging() [2/2]
Ict.Common.TLogging.TLogging |
( |
String |
AFileName, |
|
|
bool |
ASuppressDateAndTime = false |
|
) |
| |
|
inline |
Creates a logger that can log both to Console or file.
- Parameters
-
AFileName | File to which the output should be written if logging to the logfile is requested. |
ASuppressDateAndTime | Set to true to suppress the logging of date and time in log files (default= false). |
◆ CanWriteLogFile()
bool Ict.Common.TLogging.CanWriteLogFile |
( |
out String |
ALogFileMsg | ) |
|
|
inline |
◆ GetConsoleLog()
static String Ict.Common.TLogging.GetConsoleLog |
( |
| ) |
|
|
inlinestatic |
Gets the current console log text. Throws an exception if the console text is being written to a console. You should call SendConsoleOutputToString to send output to this string
- Returns
◆ GetLogFileName()
static String Ict.Common.TLogging.GetLogFileName |
( |
| ) |
|
|
inlinestatic |
returns the name of the current log file
- Returns
- the path of the current log file
◆ Log() [1/4]
static void Ict.Common.TLogging.Log |
( |
ArrayList |
aList, |
|
|
bool |
isException |
|
) |
| |
|
inlinestatic |
Logs a number of messages in one go. Output goes to both Screen and Logfile.
- Parameters
-
aList | An ArrayList containing a number of Log messages |
isException | If set to TRUE, an information which states that all following Log messages are Exceptions is written before the Log messages are logged. |
- Returns
- void
◆ Log() [2/4]
static void Ict.Common.TLogging.Log |
( |
ArrayList |
aList, |
|
|
bool |
isException, |
|
|
TLoggingType |
Loggingtype |
|
) |
| |
|
inlinestatic |
Logs a number of messages in one go. Output destination can be selected with the Loggingtype flag.
- Parameters
-
aList | An ArrayList containing a number of Log messages |
isException | If set to TRUE, an information which states that all following Log messages are Exceptions is written before the Log messages are logged. |
Loggingtype | logging destination (eg. console, logfile etc) |
- Returns
- void
◆ Log() [3/4]
Logs a message. Output destination can be selected with the Loggingtype flag.
- Parameters
-
Text | Log message |
ALoggingType | Determines the output destination. Note: More than one output destination can be chosen! |
ACustomStatusCallbackProcedure | Optional instance of a custom callback procedure for writing to the StatusBar of a Form (default = null). |
◆ Log() [4/4]
Logs a message. Output goes to both Screen and Logfile and - if a callback has been set up with SetStatusBarProcedure or gets passed in with ACustomStatusCallbackProcedure - to a Status Bar of a Form, too.
- Parameters
-
Text | Log message |
ACustomStatusCallbackProcedure | Optional instance of a custom callback procedure for writing to the StatusBar of a Form (default = null). |
◆ LogAtLevel() [1/2]
static void Ict.Common.TLogging.LogAtLevel |
( |
Int32 |
ALevel, |
|
|
string |
AText, |
|
|
TLoggingType |
ALoggingType |
|
) |
| |
|
inlinestatic |
Log if level is this high. Output destination can be selected with the Loggingtype flag.
- Parameters
-
ALevel | |
AText | |
ALoggingType | |
◆ LogAtLevel() [2/2]
static void Ict.Common.TLogging.LogAtLevel |
( |
Int32 |
Level, |
|
|
string |
Text |
|
) |
| |
|
inlinestatic |
Log if level is this high
- Parameters
-
◆ LogDataTable()
static void Ict.Common.TLogging.LogDataTable |
( |
DataTable |
DT | ) |
|
|
inlinestatic |
Writes the contents of a DataTable to the log file. Useful to have this available for debugging.
- Parameters
-
◆ LogException()
static void Ict.Common.TLogging.LogException |
( |
Exception |
AEx, |
|
|
String |
AMethodSignature = "" |
|
) |
| |
|
inlinestatic |
Logs a number of messages in one go. Output goes to both Screen and Logfile.
- Parameters
-
AEx | The exception to log |
AMethodSignature | The exception to log |
- Returns
- void
◆ LogStackTrace()
log the current stack trace
- Parameters
-
ALoggingtype | destination of logging |
◆ ResetStaticVariables()
static void Ict.Common.TLogging.ResetStaticVariables |
( |
| ) |
|
|
inlinestatic |
reset the static variables for each Web Request call.
◆ SendConsoleOutputToString()
Call this method on Windows Forms apps to send the 'console' output to a dynamic string
◆ SetContext()
static void Ict.Common.TLogging.SetContext |
( |
String |
context | ) |
|
|
inlinestatic |
Set the context of the program situation. It is displayed in the next log messages.
- Parameters
-
context | This will be displayed in the following calls to Log; can be reset with an empty string |
- Returns
- void
◆ SetStatusBarProcedure()
This sets the procedure that is called with the text as an parameter. It can be used to update a status bar.
- Returns
- void
◆ StackTraceToText()
static String Ict.Common.TLogging.StackTraceToText |
( |
StackTrace |
st | ) |
|
|
inlinestatic |
◆ TLogNewMessageCallback()
delegate void Ict.Common.TLogging.TLogNewMessageCallback |
( |
| ) |
|
his is used for Windows Forms logging
◆ TStatusCallbackProcedure()
delegate void Ict.Common.TLogging.TStatusCallbackProcedure |
( |
string |
msg | ) |
|
this is used for statusbar updates
◆ DebugLevel
int Ict.Common.TLogging.DebugLevel = 0 |
|
static |
some log messages will be only displayed at a certain DebugLevel
◆ DEBUGLEVEL_COORDINATED_DB_ACCESS
const int Ict.Common.TLogging.DEBUGLEVEL_COORDINATED_DB_ACCESS = 3 |
|
static |
the debuglevel that is required for saving some detailed log files for the co-ordinated DB Access.
◆ DEBUGLEVEL_REPORTING
const int Ict.Common.TLogging.DEBUGLEVEL_REPORTING = 5 |
|
static |
the debuglevel that is required for saving some detailed log files for the reporting
◆ DEBUGLEVEL_TRACE
const int Ict.Common.TLogging.DEBUGLEVEL_TRACE = 10 |
|
static |
the debuglevel that is required for stacktrace to be printed; this is related to the mono bug described in the code
◆ DEFAULTUSERNAMEPREFIX
const string Ict.Common.TLogging.DEFAULTUSERNAMEPREFIX = "MiB" |
|
static |
this is the default prefix for the username
◆ LOG_PREFIX_ERROR
const string Ict.Common.TLogging.LOG_PREFIX_ERROR = "ERROR: " |
|
static |
Prefix that can be used for logging messages that are errors.
You can prefix any string that you want to be written to the log with this. (The prefix is not translatable.)
◆ LOG_PREFIX_INFO
const string Ict.Common.TLogging.LOG_PREFIX_INFO = "INFO: " |
|
static |
Prefix that can be used for logging messages that are purely informational.
You can prefix any string that you want to be written to the log with this. (The prefix is not translatable.)
◆ LOG_PREFIX_WARNING
const string Ict.Common.TLogging.LOG_PREFIX_WARNING = "WARNING: " |
|
static |
Prefix that can be used for logging messages that are warnings.
You can prefix any string that you want to be written to the log with this. (The prefix is not translatable.)
◆ DL
int Ict.Common.TLogging.DL |
|
staticget |
DL is a abbreviated synonym for DebugLevel (more convenient)
◆ NoLoggingToConsoleError
bool Ict.Common.TLogging.NoLoggingToConsoleError |
|
staticgetset |
No logging of messages to Console.Error? Set this to true if the PetraServer runs as a Windows Service to prevent Bug #5846!
◆ UserNamePrefix
string Ict.Common.TLogging.UserNamePrefix |
|
staticgetset |
property for the prefix that describes the
The documentation for this class was generated from the following file: