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...
|
|
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
- 1.0
- Date
- 2022-01-10
- Copyright
- Kohi Game Engine is Copyright (c) Travis Vroman 2021-2022
◆ 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.
◆ 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.
- Parameters
-
level | The log level to use. |
message | The message to be logged. |
... | Any formatted data that should be included in the log entry. |
◆ logging_initialize()
b8 logging_initialize |
( |
u64 * |
memory_requirement, |
|
|
void * |
state, |
|
|
void * |
config |
|
) |
| |
Initializes logging system. Call twice; once with state = 0 to get required memory size, then a second time passing allocated memory to state.
- Parameters
-
memory_requirement | A pointer to hold the required memory size of internal state. |
state | 0 if just requesting memory requirement, otherwise allocated block of memory. |
config | Ignored. |
- Returns
- b8 True on success; otherwise false.
◆ logging_shutdown()
void logging_shutdown |
( |
void * |
state | ) |
|
Shuts down the logging system.
- Parameters
-
state | A pointer to the system state. |