42 lines
713 B
C
42 lines
713 B
C
#ifndef LOG_H_
|
|
#define LOG_H_
|
|
|
|
#define _POSIX_C_SOURCE 200809L
|
|
#define _DEFAULT_SOURCE
|
|
#define _XOPEN_SOURCE 700
|
|
|
|
#include <stdio.h>
|
|
#include <stdarg.h>
|
|
#include <stdbool.h>
|
|
#include <syslog.h>
|
|
#include <time.h>
|
|
|
|
#include "color.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef enum
|
|
{
|
|
LG_INFO,
|
|
LG_WARN,
|
|
LG_ERR,
|
|
LG_SUCCESS
|
|
}
|
|
loglevel_t;
|
|
|
|
int supports_utf8(void);
|
|
const char *p2s(int priority);
|
|
|
|
void lg_printf(loglevel_t loglevel, const char *fmt, ...);
|
|
void lg_printf_no_newline(loglevel_t loglevel, const char *fmt, ...);
|
|
void lg_syslog(int priority, const char *fmt, ...);
|
|
void lg_log(bool use_syslog, FILE *logfile, int priority, const char *fmt, ...);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* LOG_H_ */
|