Add line endings to logger

This commit is contained in:
2023-11-06 13:49:48 +01:00
parent 570c61f379
commit 71571c4e16
2 changed files with 7 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
/** /**
* @file log.h * @file log.h
* @brief Logger header * @brief Logger header
* @author Lorenz C. * @authors Lorenz C. Speetjens S.
* *
* This logging library provides a simple logging interface with different verbosity levels. * This logging library provides a simple logging interface with different verbosity levels.
* Each tag can have its own log level. * Each tag can have its own log level.
@@ -88,27 +88,27 @@
#endif #endif
#if LOGGER_LEVEL <= 1 #if LOGGER_LEVEL <= 1
#define LOG_DEBUG(tag, fmt, ...) printf(LOG_COLOR_D"[Debug] (%lu) [%s]: " fmt LOG_RESET_COLOR, logger_get_timestamp(), tag, ##__VA_ARGS__) #define LOG_DEBUG(tag, fmt, ...) printf(LOG_COLOR_D"[Debug] (%lu) [%s]: " fmt LOG_RESET_COLOR "\r\n", logger_get_timestamp(), tag, ##__VA_ARGS__)
#else #else
#define LOG_DEBUG(tag, fmt, ...) #define LOG_DEBUG(tag, fmt, ...)
#endif #endif
#if LOGGER_LEVEL <= 2 #if LOGGER_LEVEL <= 2
#define LOG_INFO(tag, fmt, ...) printf(LOG_COLOR_I"[Info] (%lu) [%s]: " fmt LOG_RESET_COLOR, logger_get_timestamp(), tag, ##__VA_ARGS__) #define LOG_INFO(tag, fmt, ...) printf(LOG_COLOR_I"[Info] (%lu) [%s]: " fmt LOG_RESET_COLOR "\r\n", logger_get_timestamp(), tag, ##__VA_ARGS__)
#else #else
#define LOG_INFO(tag, fmt, ...) #define LOG_INFO(tag, fmt, ...)
#endif #endif
#if LOGGER_LEVEL <= 3 #if LOGGER_LEVEL <= 3
#define LOG_WARN(tag, fmt, ...) printf(LOG_COLOR_W"[Warning] (%lu) [%s]: " fmt LOG_RESET_COLOR, logger_get_timestamp(), tag, ##__VA_ARGS__) #define LOG_WARN(tag, fmt, ...) printf(LOG_COLOR_W"[Warning] (%lu) [%s]: " fmt LOG_RESET_COLOR "\r\n", logger_get_timestamp(), tag, ##__VA_ARGS__)
#else #else
#define LOG_WARN(tag, fmt, ...) #define LOG_WARN(tag, fmt, ...)
#endif #endif
#if LOGGER_LEVEL <= 4 #if LOGGER_LEVEL <= 4
#define LOG_CRIT(tag, fmt, ...) printf(LOG_COLOR_C"[Critical] (%lu) [%s]: " fmt LOG_RESET_COLOR, logger_get_timestamp(), tag, ##__VA_ARGS__) #define LOG_CRIT(tag, fmt, ...) printf(LOG_COLOR_C"[Critical] (%lu) [%s]: " fmt LOG_RESET_COLOR "\r\n", logger_get_timestamp(), tag, ##__VA_ARGS__)
#else #else
#define LOG_CRIT(tag, fmt, ...) #define LOG_CRIT(tag, fmt, ...)
#endif #endif
#if LOGGER_LEVEL <= 4 #if LOGGER_LEVEL <= 4
#define LOG_FATAL(tag, fmt, ...) printf(LOG_COLOR_F"[Fatal] (%lu) [%s]: " fmt LOG_RESET_COLOR, logger_get_timestamp(), tag, ##__VA_ARGS__) #define LOG_FATAL(tag, fmt, ...) printf(LOG_COLOR_F"[Fatal] (%lu) [%s]: " fmt LOG_RESET_COLOR "\r\n", logger_get_timestamp(), tag, ##__VA_ARGS__)
#else #else
#define LOG_FATAL(tag, fmt, ...) #define LOG_FATAL(tag, fmt, ...)
#endif #endif

View File

@@ -1,7 +1,7 @@
/** /**
* @file log.c * @file log.c
* @brief Logger implementation * @brief Logger implementation
* @author Lorenz C. && Speetjens S. * @authors Lorenz C. && Speetjens S.
*/ */
#include <stdarg.h> #include <stdarg.h>