fix: logger leaking path
This commit is contained in:
parent
fbe39fe7c6
commit
532750da74
2 changed files with 8 additions and 10 deletions
|
@ -5,10 +5,9 @@ add_executable(controller main.c)
|
||||||
|
|
||||||
option(WIRING_PI_DEBUG "Use WiringPi Debugging Tool (OFF)" OFF)
|
option(WIRING_PI_DEBUG "Use WiringPi Debugging Tool (OFF)" OFF)
|
||||||
|
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -Wextra -Werror -Wpedantic -lwiringPi -lwiringPiDev -luuid -llmdb -g")
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wpedantic -Werror -Wall -Wextra -lwiringPi -lwiringPiDev -luuid -llmdb -ffile-prefix-map=${CMAKE_SOURCE_DIR}/=/")
|
||||||
|
|
||||||
string(LENGTH "${CMAKE_SOURCE_DIR}/" SOURCE_PATH_SIZE)
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -fprofile-arcs -ftest-coverage")
|
||||||
add_definitions("-DSOURCE_PATH_SIZE=${SOURCE_PATH_SIZE}")
|
|
||||||
|
|
||||||
if(WIRING_PI_DEBUG)
|
if(WIRING_PI_DEBUG)
|
||||||
message("Showing wiringPi calls as debug")
|
message("Showing wiringPi calls as debug")
|
||||||
|
|
|
@ -6,16 +6,15 @@
|
||||||
|
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <macros.h>
|
|
||||||
|
|
||||||
void
|
void
|
||||||
logger_log(FILE *stream, log_level_t level, const char *filename, int line, const char *func, const char *msg, ...);
|
logger_log(FILE *stream, log_level_t level, const char *filename, int line, const char *func, const char *msg, ...);
|
||||||
|
|
||||||
#define LOG_TRACE(...) logger_log(stdout, LOG_LEVEL_TRACE, __FILENAME__, __LINE__, __func__, ##__VA_ARGS__)
|
#define LOG_TRACE(...) logger_log(stdout, LOG_LEVEL_TRACE, __FILE__, __LINE__, __func__, ##__VA_ARGS__)
|
||||||
#define LOG_DEBUG(...) logger_log(stdout, LOG_LEVEL_DEBUG, __FILENAME__, __LINE__, __func__, ##__VA_ARGS__)
|
#define LOG_DEBUG(...) logger_log(stdout, LOG_LEVEL_DEBUG, __FILE__, __LINE__, __func__, ##__VA_ARGS__)
|
||||||
#define LOG_INFO(...) logger_log(stdout, LOG_LEVEL_INFO , __FILENAME__, __LINE__, __func__, ##__VA_ARGS__)
|
#define LOG_INFO(...) logger_log(stdout, LOG_LEVEL_INFO , __FILE__, __LINE__, __func__, ##__VA_ARGS__)
|
||||||
#define LOG_WARN(...) logger_log(stdout, LOG_LEVEL_WARN , __FILENAME__, __LINE__, __func__, ##__VA_ARGS__)
|
#define LOG_WARN(...) logger_log(stdout, LOG_LEVEL_WARN , __FILE__, __LINE__, __func__, ##__VA_ARGS__)
|
||||||
#define LOG_ERROR(...) logger_log(stderr, LOG_LEVEL_ERROR, __FILENAME__, __LINE__, __func__, ##__VA_ARGS__)
|
#define LOG_ERROR(...) logger_log(stderr, LOG_LEVEL_ERROR, __FILE__, __LINE__, __func__, ##__VA_ARGS__)
|
||||||
#define LOG_FATAL(...) logger_log(stderr, LOG_LEVEL_FATAL, __FILENAME__, __LINE__, __func__, ##__VA_ARGS__)
|
#define LOG_FATAL(...) logger_log(stderr, LOG_LEVEL_FATAL, __FILE__, __LINE__, __func__, ##__VA_ARGS__)
|
||||||
|
|
||||||
#endif //CONTROLLER_LOGGER_H
|
#endif //CONTROLLER_LOGGER_H
|
||||||
|
|
Loading…
Reference in a new issue