aboutsummaryrefslogtreecommitdiff
path: root/include/log.h
blob: 04ceca4d244fc76bb078057a99f87714ebee7777 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef LOG_H
#define LOG_H

#ifndef RSSMAIL_DISABLE_LOGGING

#include <stdlib.h>

#define LOG(fmt, ...) printf(fmt "\n", ##__VA_ARGS__)
#define LOG_ERROR(fmt, ...) fprintf(stderr, fmt "\n", ##__VA_ARGS__)

#ifdef DEBUG
#define LOG_DEBUG(fmt, ...) printf("DEBUG: " fmt "\n", ##__VA_ARGS__)
#else
#define LOG_DEBUG(fmt, ...) (void)(fmt)
#endif

#else

#define LOG(fmt, ...) (void)(fmt)
#define LOG_ERROR(fmt, ...) (void)(fmt)
#define LOG_DEBUG(fmt, ...) (void)(fmt)

#endif

#endif