add notice when loading file

Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
This commit is contained in:
Michel-FK 2021-04-12 08:13:01 +02:00
parent 4b67fe0851
commit 54d1051d3f

View File

@ -38,6 +38,7 @@
#include "uinput.h"
//#define DEBUG_CONFIG
#define NOTICE_CONFIG
#define ERROR_CONFIG
#ifdef DEBUG_CONFIG
@ -46,6 +47,12 @@
#define FK_DEBUG(...)
#endif
#ifdef NOTICE_CONFIG
#define FK_NOTICE(...) syslog(LOG_NOTICE, __VA_ARGS__);
#else
#define FK_NOTICE(...)
#endif
#ifdef ERROR_CONFIG
#define FK_ERROR(...) syslog(LOG_ERR, __VA_ARGS__);
#else
@ -468,6 +475,7 @@ bool parse_config_file(const char *name, mapping_list_t *list,
FILE *fp;
int line_number = 0;
FK_NOTICE("LOAD file %s\n", name);
if ((fp = fopen(name, "r")) == NULL) {
FK_ERROR("Cannot open file \"%s\"\n", name);
return false;