1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-11-27 20:51:17 +00:00
erc-c/include/log.h
2017-12-09 15:16:56 -06:00

26 lines
513 B
C

#ifndef _LOG_H_
#define _LOG_H_
#include <stdio.h>
#define LOG_FILENAME "/tmp/emp.log"
enum log_errcode {
OK = 1,
ERR_OOM, // out of memory
ERR_OOB, // out of bounds
};
extern void log_write(int, const char *, ...);
extern void log_close();
extern void log_open(FILE *);
/*
* Here we have a couple of convenience macros that abstracts the log
* level number.
*/
#define log_critical(...) log_write(0, __VA_ARGS__)
#define log_error(...) log_write(0, __VA_ARGS__)
#endif