1
2
3
4
5
6
7
8
9#ifndef RTRS_LOG_H
10#define RTRS_LOG_H
11
12#define rtrs_log(fn, obj, fmt, ...) \
13 fn("<%s>: " fmt, obj->sessname, ##__VA_ARGS__)
14
15#define rtrs_err(obj, fmt, ...) \
16 rtrs_log(pr_err, obj, fmt, ##__VA_ARGS__)
17#define rtrs_err_rl(obj, fmt, ...) \
18 rtrs_log(pr_err_ratelimited, obj, fmt, ##__VA_ARGS__)
19#define rtrs_wrn(obj, fmt, ...) \
20 rtrs_log(pr_warn, obj, fmt, ##__VA_ARGS__)
21#define rtrs_wrn_rl(obj, fmt, ...) \
22 rtrs_log(pr_warn_ratelimited, obj, fmt, ##__VA_ARGS__)
23#define rtrs_info(obj, fmt, ...) \
24 rtrs_log(pr_info, obj, fmt, ##__VA_ARGS__)
25#define rtrs_info_rl(obj, fmt, ...) \
26 rtrs_log(pr_info_ratelimited, obj, fmt, ##__VA_ARGS__)
27
28#endif
29