Logging
Functions
Close Log Process
Ensures propper memory clean-up prior to exit, if needed. Used in sk_init_looging ().
Signatures:
Init Custom Logger
Init Custom Logger
Initialises the logging mode for logged messages to be written to the text-based console.
Parameters:
Name | Type | Description |
---|---|---|
mode | Log Mode | The mode of log output i.e. whether there should be output to the console, a text file, or both. Pass your choice of mode variable in by reference. |
Signatures:
Init Custom Logger
Initialises the logging mode between either writing to a file or both a file and the text-based console.
Parameters:
Name | Type | Description |
---|---|---|
app_name | String | The name of the application being written requiring logging |
override_prev_log | Boolean | Determines whether or not a new logging session should override the existing file, if any. Set this to false if you want new log messages to be appended to the bottom of the file; otherwise set it to true if you would like a new file to be created on top of the old one. |
mode | Log Mode | The mode of log output i.e. whether there should be output to the console, a text file, or both. Pass your choice of mode variable in by reference. |
Signatures:
Log
Send a message to the message log. The message will be written if the log level for the program is set to display this.
Parameters:
Name | Type | Description |
---|---|---|
level | Log Level | The level of the message to log |
message | String | The message to be shown |
Signatures:
Types
Log Level
Constant | Description |
---|---|
NONE | Output to the message log but without a specified level |
INFO | Output information to the message log |
DEBUG | Output a debug message to the message log |
WARNING | Output a warning message to the message log |
ERROR | Output an error message to the message log |
FATAL | Output an error message to the message log |
Constant | Description |
---|---|
LogLevel.None | Output to the message log but without a specified level |
LogLevel.Info | Output information to the message log |
LogLevel.Debug | Output a debug message to the message log |
LogLevel.Warning | Output a warning message to the message log |
LogLevel.Error | Output an error message to the message log |
LogLevel.Fatal | Output an error message to the message log |
Constant | Description |
---|---|
log_level.none | Output to the message log but without a specified level |
log_level.info | Output information to the message log |
log_level.debug | Output a debug message to the message log |
log_level.warning | Output a warning message to the message log |
log_level.error | Output an error message to the message log |
log_level.fatal | Output an error message to the message log |
Constant | Description |
---|---|
LogLevel.None | Output to the message log but without a specified level |
LogLevel.Info | Output information to the message log |
LogLevel.Debug | Output a debug message to the message log |
LogLevel.Warning | Output a warning message to the message log |
LogLevel.Error | Output an error message to the message log |
LogLevel.Fatal | Output an error message to the message log |
Defines the available levels for log messages. This allows categorisation of log messages which can then be filtered allowing messages below a given level to be ignored.
Log Mode
Constant | Description |
---|---|
LOG_NONE | Set the logging mode to none for nothing to be logged to the console or a file. |
LOG_CONSOLE | Ensure that output only directs to the on-screen, text-based console.. |
LOG_FILE_ONLY | Ensure that output only directs to a text file.. |
LOG_CONSOLE_AND_FILE | Direct ouput to both the console and a file. |
Constant | Description |
---|---|
LogMode.LogNone | Set the logging mode to none for nothing to be logged to the console or a file. |
LogMode.LogConsole | Ensure that output only directs to the on-screen, text-based console.. |
LogMode.LogFileOnly | Ensure that output only directs to a text file.. |
LogMode.LogConsoleAndFile | Direct ouput to both the console and a file. |
Constant | Description |
---|---|
log_mode.log_none | Set the logging mode to none for nothing to be logged to the console or a file. |
log_mode.log_console | Ensure that output only directs to the on-screen, text-based console.. |
log_mode.log_file_only | Ensure that output only directs to a text file.. |
log_mode.log_console_and_file | Direct ouput to both the console and a file. |
Constant | Description |
---|---|
LogMode.LogNone | Set the logging mode to none for nothing to be logged to the console or a file. |
LogMode.LogConsole | Ensure that output only directs to the on-screen, text-based console.. |
LogMode.LogFileOnly | Ensure that output only directs to a text file.. |
LogMode.LogConsoleAndFile | Direct ouput to both the console and a file. |
Defines the available modes of logging, indicating where messages are written to.