Implement logger functionality and signal handling: add Logger structure with mutex, logging functions, and handle SIGINT in utils.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
#ifndef __LOGGER_H__
|
||||
#define __LOGGER_H__
|
||||
|
||||
#include "main.h"
|
||||
#include "rfid_handler.h"
|
||||
#include "utils.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
pthread_mutex_t lock;
|
||||
FILE *f_log;
|
||||
} Logger;
|
||||
|
||||
Logger *initLogger(const char *_filename);
|
||||
int logErrorEvent(Logger *_logger, const char *_message);
|
||||
int logWarningEvent(Logger *_logger, const char *_message);
|
||||
int logHardwareEvent(Logger *_logger, const char *_event_origin, const char *_message);
|
||||
int logInfoEvent(Logger *_logger, const char *_message);
|
||||
int endLogger(Logger *_logger);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user