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 | Value | 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 |
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 | Value | 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. |
Defines the available modes of logging, indicating where messages are written to.