$darkmode
#include "log.h"#include "platform/platform_time.h"#include "platform/platform_utils.h"#include "tracy_log.h"#include "utils.h"#include <stdarg.h>#include <stdbool.h>#include <stdio.h>#include <stdlib.h>#include <strings.h>#include <time.h>Enumerations | |
| enum | { MILLI_DIVISOR = 1000000 , PREFIX_BUFFER_SIZE = 128 , TIME_BUFFER_SIZE = 24 , MSG_BUFFER_SIZE = 1024 } |
Functions | |
| static LogLevel | string_to_level (const char *str) |
| static void | log_init (void) |
| static const char * | level_to_string (LogLevel level) |
| void | log_set_level (LogLevel level) |
| Sets the global minimum log level. More... | |
| void | log_set_callback (LogCallback callback) |
| Sets a custom callback for log messages. More... | |
| LogLevel | log_get_level (void) |
| Retrieves the current global log level. More... | |
| void | log_message (LogLevel level, const char *tag, const char *format,...) |
| Logs a formatted message. More... | |
Variables | |
| static LogLevel | g_log_level = LOG_LEVEL_INFO |
| static bool | g_log_initialized = false |
| static LogCallback | g_log_callback = NULL |
|
static |
| LogLevel log_get_level | ( | void | ) |
Retrieves the current global log level.
|
static |
| void log_message | ( | LogLevel | level, |
| const char * | tag, | ||
| const char * | format, | ||
| ... | |||
| ) |
Logs a formatted message.
Format: YYYY-MM-DD HH:MM:SS,mmm - tag - LEVEL - message
| level | Severity level. |
| tag | Category label (e.g., "RENDER", "INPUT"). |
| format | Printf-style format string. |
| ... | Arguments for the format string. |
| void log_set_callback | ( | LogCallback | callback | ) |
Sets a custom callback for log messages.
| callback | Function to call for each log message, or NULL to disable. |
| void log_set_level | ( | LogLevel | level | ) |
Sets the global minimum log level.
| level | Levels below this will be ignored. |
|
static |
|
static |
|
static |
|
static |