repo.or.cz
/
rfmod.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fix typo
[rfmod.git]
/
logging.c
blob
46d0c8094f11ec74431829ef918e0d8002f67953
1
#include <stdio.h>
2
#include <stdarg.h>
3
#include <stdlib.h>
4
#include <sys/param.h>
5
#include <time.h>
6
#include <sys/time.h>
7
#include <syslog.h>
8
9
#include
"logging.h"
10
11
int
loglevel
=
LOG_ERR
;
12
13
void
logwrite_inc_level
() {
14
loglevel
++;
15
}
16
17
void
logwrite_dec_level
() {
18
if
(
loglevel
>
LOG_ERR
) {
19
loglevel
--;
20
}
21
}
22
23
void
logwrite
(
int
level
,
const char
*
format
, ...) {
24
va_list
pvar
;
25
26
if
(
level
>
loglevel
)
27
return
;
28
29
va_start
(
pvar
,
format
);
30
vsyslog
(
level
,
format
,
pvar
);
31
va_end
(
pvar
);
32
}