Logging
Functions
Section titled “Functions”Ensures propper memory clean-up prior to exit, if needed. Used in sk_init_looging ().
Signatures:
void close_log_process()public static void SplashKit.CloseLogProcess();def close_log_process():procedure CloseLogProcess()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 SplashKit.InitCustomLogger(LogMode mode);def init_custom_logger(mode):procedure InitCustomLogger(mode: LogMode)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 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)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 SplashKit.Log(LogLevel level, string message);def log(level, message):procedure Log(level: LogLevel; message: String)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.
| 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 |
|---|---|
| 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 |
|---|---|
| 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 modes of logging, indicating where messages are written to.
| 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 |
|---|---|
| LogMode.log_none | Set the logging mode to none for nothing to be logged to the console or a file. |
| LogMode.log_console | Ensure that output only directs to the on-screen, text-based console.. |
| LogMode.log_file_only | Ensure that output only directs to a text file.. |
| LogMode.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. |