STM32 Logger
Loading...
Searching...
No Matches
logger.h
Go to the documentation of this file.
1
33
34#pragma once
35
36#include <stdint.h>
37#include <stdarg.h>
38
39#ifdef __has_include
40# if __has_include("logger_config.h")
41# include "logger_config.h"
42# endif
43#endif
44
55
61void Log_Init(void);
62
69void Log_SetLevel(LogLevel level);
70
78void Log(LogLevel level, const char* format, ...);
79
85void Log_Flush(void);
86
92void Log_Disable(void);
93
98__attribute__((weak)) void Log_Write_UART(const char* msg);
99
104__attribute__((weak)) void Log_Write_SD(const char* msg);
void Log_Disable(void)
Disable all logging at runtime.
Definition logger.c:135
void Log(LogLevel level, const char *format,...)
Log a formatted message if the level passes the threshold.
Definition logger.c:149
void Log_Init(void)
Initialize the logging system.
Definition logger.c:113
__attribute__((weak)) void Log_Write_UART(const char *msg)
UART output hook. Can be overridden by user.
Definition logger.c:196
void Log_SetLevel(LogLevel level)
Set the active logging level.
Definition logger.c:128
LogLevel
Defines severity levels for logging.
Definition logger.h:49
@ LOG_LEVEL_DEBUG
Definition logger.h:53
@ LOG_LEVEL_ERROR
Definition logger.h:50
@ LOG_LEVEL_WARN
Definition logger.h:51
@ LOG_LEVEL_INFO
Definition logger.h:52
void Log_Flush(void)
Flush output buffers.
Definition logger.c:169