This file contains structures and logic pertaining to the logging system.
More...
Go to the source code of this file.
|
#define | LOG_WARN_ENABLED 1 |
| Indicates if warning level logging is enabled. More...
|
|
#define | LOG_INFO_ENABLED 1 |
| Indicates if info level logging is enabled. More...
|
|
#define | LOG_DEBUG_ENABLED 1 |
| Indicates if debug level logging is enabled. More...
|
|
#define | LOG_TRACE_ENABLED 1 |
| Indicates if trace level logging is enabled. More...
|
|
#define | KFATAL(message, ...) _log_output(LOG_LEVEL_FATAL, message, ##__VA_ARGS__); |
| Logs a fatal-level message. Should be used to stop the application when hit. More...
|
|
#define | KERROR(message, ...) _log_output(LOG_LEVEL_ERROR, message, ##__VA_ARGS__); |
| Logs an error-level message. Should be used to indicate critical runtime problems that cause the application to run improperly or not at all. More...
|
|
#define | KWARN(message, ...) _log_output(LOG_LEVEL_WARN, message, ##__VA_ARGS__); |
| Logs a warning-level message. Should be used to indicate non-critial problems with the application that cause it to run suboptimally. More...
|
|
#define | KINFO(message, ...) _log_output(LOG_LEVEL_INFO, message, ##__VA_ARGS__); |
| Logs an info-level message. Should be used for non-erronuous informational purposes. More...
|
|
#define | KDEBUG(message, ...) _log_output(LOG_LEVEL_DEBUG, message, ##__VA_ARGS__); |
| Logs a debug-level message. Should be used for debugging purposes. More...
|
|
#define | KTRACE(message, ...) _log_output(LOG_LEVEL_TRACE, message, ##__VA_ARGS__); |
| Logs a trace-level message. Should be used for verbose debugging purposes. More...
|
|
|
KAPI void | logger_console_write_hook_set (PFN_console_write hook) |
| Provides a hook to a console (perhaps from Kohi Runtime or elsewhere) that the logging system can forward messages to. If not set, logs go straight to the platform layer. If set, messages go to the hook instead, so it would be responsible for passing messages to the platform layer. NOTE: May only be set once - additional calls will overwrite. More...
|
|
KAPI void | _log_output (log_level level, const char *message,...) |
| Outputs logging at the given level. NOTE: This should not be called directly. More...
|
|
This file contains structures and logic pertaining to the logging system.
- Author
- Travis Vroman (travi.nosp@m.s@ko.nosp@m.hieng.nosp@m.ine..nosp@m.com)
- Version
- 2.0
- Date
- 2024-04-02
- Copyright
- Kohi Game Engine is Copyright (c) Travis Vroman 2021-2024
◆ KDEBUG
Logs a debug-level message. Should be used for debugging purposes.
- Parameters
-
message | The message to be logged. |
... | Any formatted data that should be included in the log entry. |
◆ KERROR
Logs an error-level message. Should be used to indicate critical runtime problems that cause the application to run improperly or not at all.
- Parameters
-
message | The message to be logged. |
... | Any formatted data that should be included in the log entry. |
◆ KFATAL
Logs a fatal-level message. Should be used to stop the application when hit.
- Parameters
-
message | The message to be logged. Can be a format string for additional parameters. |
... | Additional parameters to be logged. |
◆ KINFO
Logs an info-level message. Should be used for non-erronuous informational purposes.
- Parameters
-
message | The message to be logged. |
... | Any formatted data that should be included in the log entry. |
◆ KTRACE
Logs a trace-level message. Should be used for verbose debugging purposes.
- Parameters
-
message | The message to be logged. |
... | Any formatted data that should be included in the log entry. |
◆ KWARN
Logs a warning-level message. Should be used to indicate non-critial problems with the application that cause it to run suboptimally.
- Parameters
-
message | The message to be logged. |
... | Any formatted data that should be included in the log entry. |
◆ LOG_DEBUG_ENABLED
#define LOG_DEBUG_ENABLED 1 |
Indicates if debug level logging is enabled.
◆ LOG_INFO_ENABLED
#define LOG_INFO_ENABLED 1 |
Indicates if info level logging is enabled.
◆ LOG_TRACE_ENABLED
#define LOG_TRACE_ENABLED 1 |
Indicates if trace level logging is enabled.
◆ LOG_WARN_ENABLED
#define LOG_WARN_ENABLED 1 |
Indicates if warning level logging is enabled.
◆ log_level
Represents levels of logging.
◆ PFN_console_write
typedef void(* PFN_console_write) (log_level level, const char *message) |
◆ log_level
Represents levels of logging.
Enumerator |
---|
LOG_LEVEL_FATAL | Fatal log level, should be used to stop the application when hit.
|
LOG_LEVEL_ERROR | Error log level, should be used to indicate critical runtime problems that cause the application to run improperly or not at all.
|
LOG_LEVEL_WARN | Warning log level, should be used to indicate non-critial problems with the application that cause it to run suboptimally.
|
LOG_LEVEL_INFO | Info log level, should be used for non-erronuous informational purposes.
|
LOG_LEVEL_DEBUG | Debug log level, should be used for debugging purposes.
|
LOG_LEVEL_TRACE | Trace log level, should be used for verbose debugging purposes.
|
◆ _log_output()
KAPI void _log_output |
( |
log_level |
level, |
|
|
const char * |
message, |
|
|
|
... |
|
) |
| |
Outputs logging at the given level. NOTE: This should not be called directly.
- Parameters
-
level | The log level to use. |
message | The message to be logged. |
... | Any formatted data that should be included in the log entry. |
◆ logger_console_write_hook_set()
Provides a hook to a console (perhaps from Kohi Runtime or elsewhere) that the logging system can forward messages to. If not set, logs go straight to the platform layer. If set, messages go to the hook instead, so it would be responsible for passing messages to the platform layer. NOTE: May only be set once - additional calls will overwrite.
- Parameters
-
hook | A function pointer from the console hook. |