-
Notifications
You must be signed in to change notification settings - Fork 0
/
logging.h
39 lines (30 loc) · 807 Bytes
/
logging.h
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
32
33
34
35
36
37
38
39
#ifndef LOGGING_H
#define LOGGING_H
extern int loglevel;
#include <stdarg.h>
#include <pwd.h>
/*
* call this before using logging
*/
void initlog(const char *name);
void setloglevel(int level);
/*
* print messages when various types of events happen.
* call it like printf(), do not use a trailing newline.
*/
void debug(const char *format, ...);
void error(const char *format, ...);
void info(const char *format, ...);
/*
* helpers for above
*/
void writelog(int priority, const char *format, va_list ap);
void writescreen(int priority, const char *format, va_list ap);
/*
* similar to info, error, etc., but only print to the screen
*/
void print(const char *format, ...);
char *get_username(uid_t uid);
char *escape_percents(const char *string);
#endif
/* vim: set ts=4 sw=4 tw=0 et:*/