2
2
log.h - definitions of logging funtions
4
Copyright (C) 2002, 2003, 2007, 2008 Arthur de Jong
4
Copyright (C) 2002, 2003, 2007, 2008, 2010, 2011 Arthur de Jong
6
6
This library is free software; you can redistribute it and/or
7
7
modify it under the terms of the GNU Lesser General Public
23
23
#ifndef NSLCD__LOG_H
24
24
#define NSLCD__LOG_H 1
27
26
#include <syslog.h>
28
27
#include "compat/attrs.h"
31
29
/* set loglevel when no logging is configured */
32
void log_setdefaultloglevel(int loglevel);
35
/* configure logging to a file */
36
void log_addlogging_file(const char *filename,int loglevel);
39
/* configure logging to syslog */
40
void log_addlogging_syslog(int loglevel);
43
/* configure a null logging mode (no logging) */
44
void log_addlogging_none(void);
30
void log_setdefaultloglevel(int pri);
47
32
/* start the logging with the configured logging methods
48
33
if no method is configured yet, logging is done to syslog */
49
34
void log_startlogging(void);
52
36
/* indicate that a session id should be included in the output
53
37
and set it to a new value */
54
38
void log_newsession(void);
40
/* indicate that we should clear any session identifiers set by
42
void log_clearsession(void);
44
/* indicate that a request identifier should be included in the output
45
from this point on, until log_newsession() is called */
46
void log_setrequest(const char *format, ...)
57
49
/* log the given message using the configured logging method */
58
50
void log_log(int pri,const char *format, ...)
62
/* return the syslog loglevel represented by the string
63
return -1 on unknown */
64
int log_getloglevel(const char *lvl)
68
53
#endif /* not NSLCD__LOG_H */