mirror of
https://github.com/lxsang/ant-http
synced 2025-07-13 13:04:23 +02:00
user syslog for logging
This commit is contained in:
@ -85,9 +85,6 @@ typedef struct {
|
||||
int connection;
|
||||
int n_workers;
|
||||
int max_upload_size;
|
||||
// log
|
||||
FILE* errorfp;
|
||||
FILE* logfp;
|
||||
// ssl
|
||||
int enable_ssl;
|
||||
char* sslcert;
|
||||
|
@ -37,6 +37,7 @@ THE SOFTWARE.
|
||||
#include <time.h>
|
||||
#include <stdint.h>
|
||||
#include <errno.h>
|
||||
#include <syslog.h>
|
||||
#ifdef USE_OPENSSL
|
||||
#include <openssl/sha.h>
|
||||
#else
|
||||
@ -56,12 +57,12 @@ THE SOFTWARE.
|
||||
#define false 0
|
||||
|
||||
#ifdef DEBUG
|
||||
#define LOG(a,...) server_log(": [%s: %d]: " a "\n", __FILE__, \
|
||||
#define LOG(a,...) syslog (LOG_NOTICE,"[%s: %d]: " a "\n", __FILE__, \
|
||||
__LINE__, ##__VA_ARGS__)
|
||||
#else
|
||||
#define LOG(a,...) do{}while(0)
|
||||
#endif
|
||||
#define ERROR(a,...) error_log(": [%s: %d]: " a "\n", __FILE__, \
|
||||
#define ERROR(a,...) syslog (LOG_ERR, "[%s: %d]: " a "\n", __FILE__, \
|
||||
__LINE__, ##__VA_ARGS__)
|
||||
// add this to the utils
|
||||
#define UNUSED(x) (void)(x)
|
||||
|
Reference in New Issue
Block a user