Logging
Functions
Close Log Process
Ensures propper memory clean-up prior to exit, if needed. Used in sk_init_looging ().
Signatures:
void close_log_process()
public static void Logging.CloseLogProcess();public static void SplashKit.CloseLogProcess();
def close_log_process():
procedure CloseLogProcess()
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:
void init_custom_logger(log_mode mode)
public static void Logging.InitCustomLogger(LogMode mode);public static void SplashKit.InitCustomLogger(LogMode mode);
def init_custom_logger(mode):
procedure InitCustomLogger(mode: LogMode)
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:
void init_custom_logger(string app_name, bool override_prev_log, log_mode mode)
public static void Logging.InitCustomLogger(string appName, bool overridePrevLog, LogMode mode);public static void SplashKit.InitCustomLogger(string appName, bool overridePrevLog, LogMode mode);
def init_custom_logger__name_override_mode(app_name, override_prev_log, mode):
procedure InitCustomLogger(appName: String; overridePrevLog: Boolean; mode: LogMode)
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:
void log(log_level level, string message)
public static void Logging.Log(LogLevel level, string message);public static void SplashKit.Log(LogLevel level, string message);
def log(level, message):
procedure Log(level: LogLevel; message: String)
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.