fehQlibs 26
Qlibs
Loading...
Searching...
No Matches
logmsg.h
Go to the documentation of this file.
1#ifndef LOGMSG_H
2#define LOGMSG_H
3
4#include <errno.h>
5#include <stdlib.h>
6#include "error.h"
7
8extern void logmsg(const char *who, int ecode, unsigned int class,
9 const char *msg);
10
11/* useful combinations of params */
12/* class: FATAL (hard) - system error */
13#define err_sys(w,e) logmsg(w,e,FATAL,"")
14#define err_sys_plus(w,e,m) logmsg(w,e,FATAL,m)
15/* class: WARN (application) - temporary error */
16#define err_tmp(w,e,m) logmsg(w,e,WARN,m)
17#define err_tmp_plus(w,e,m) logmsg(w,e,WARN,m)
18/* class: facultative ('int'ernal definition */
19#define err_int(w,e,c) logmsg(w,e,c,"")
20#define err_int_plus(w,e,c,m) logmsg(w,e,c,m)
21/* log messages */
22/* #define log(w,m) logmsg(w,0,LOG,m) // obsoleted by */
23#define log_who(w,m) logmsg(w,0,LOG,m)
24#define log_anon(m) logmsg("",0,LOG,m)
25#define log_cat(n) logmsg("",0,CAT,m)
26
27/* build log message from multiple partial strings */
28extern char *build_log_msg(const char *[]);
29#define B(...) build_log_msg((const char *[]){__VA_ARGS__,NULL}) // K/R sect. 7.3
30
31#endif
char * build_log_msg(const char *[])
Definition: logmsg.c:19
void logmsg(const char *who, int ecode, unsigned int class, const char *msg)
Definition: logmsg.c:30