Thomas Kolb
6cd65091ff
- Working version with the following features: - Directory listing and navigation - Download files - HTTP error pages (403, 404, 500) - Verbose logging
28 lines
813 B
C
28 lines
813 B
C
#ifndef LOGGER_H
|
|
#define LOGGER_H
|
|
|
|
#include <semaphore.h>
|
|
#include <stdarg.h>
|
|
|
|
static const int LVL_FATAL = 0; /*!< Fatal message level */
|
|
static const int LVL_ERR = 5; /*!< Error message level */
|
|
static const int LVL_WARN = 50; /*!< Warning message level */
|
|
static const int LVL_INFO = 100; /*!< Information message level */
|
|
static const int LVL_DEBUG = 200; /*!< Debug message level */
|
|
static const int LVL_DUMP = 500; /*!< Dump message level */
|
|
|
|
extern sem_t logger_semaphore;
|
|
extern int logger_verbosity;
|
|
extern int logger_use_colors;
|
|
|
|
void logger_init(void);
|
|
void logger_shutdown(void);
|
|
void logger_enable_colors(int enable);
|
|
void logger_set_verbosity(int verbosity);
|
|
|
|
void logger_log(int level, const char *format, ...);
|
|
|
|
#define LOG(level, ...) logger_log(level, __VA_ARGS__)
|
|
|
|
#endif // LOGGER_H
|