File: log.h

package info (click to toggle)
logrotate 3.18.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 1,820 kB
  • sloc: sh: 6,119; ansic: 4,944; makefile: 139
file content (31 lines) | stat: -rw-r--r-- 602 bytes parent folder | download
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
26
27
28
29
30
31
#ifndef H_LOG
#define H_LOG

#include <stdio.h>

#define MESS_REALDEBUG  1
#define MESS_DEBUG      2
#define MESS_VERBOSE    3
#define MESS_NORMAL     4
#define MESS_ERROR      5
#define MESS_FATAL      6

void message(int level, const char *format, ...)
#ifdef __GNUC__
    __attribute__ ((format(printf, 2, 3)));
#else
;
#endif

#define message_OOM() \
    do { \
        message(MESS_ERROR, "cannot allocate memory [%s():%d]\n", __func__, __LINE__); \
    } while(0)

void logSetMessageFile(FILE * f);
void logToSyslog(int enable);
void logSetLevel(int level);

#endif

/* vim: set et sw=4 ts=4: */