-
Notifications
You must be signed in to change notification settings - Fork 33
/
node-syslog.js
64 lines (59 loc) · 1.06 KB
/
node-syslog.js
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
var SyslogWrapper = require('./build/Release/syslog');
/*
* export Syslog as module
*/
module.exports = {
init: SyslogWrapper.init,
log: SyslogWrapper.log,
setMask: SyslogWrapper.setMask,
close: SyslogWrapper.close,
version: '1.2.0',
/*
* facilities
*/
LOG_KERN : (0<<3),
LOG_USER : (1<<3),
LOG_MAIL : (2<<3),
LOG_DAEMON : (3<<3),
LOG_AUTH : (4<<3),
LOG_SYSLOG : (5<<3),
LOG_LPR : (6<<3),
LOG_NEWS : (7<<3),
LOG_UUCP : (8<<3),
LOG_LOCAL0 : (16<<3),
LOG_LOCAL1 : (17<<3),
LOG_LOCAL2 : (18<<3),
LOG_LOCAL3 : (19<<3),
LOG_LOCAL4 : (20<<3),
LOG_LOCAL5 : (21<<3),
LOG_LOCAL6 : (22<<3),
LOG_LOCAL7 : (23<<3),
/*
* option flag for openlog
*/
LOG_PID : 0x01,
LOG_CONS : 0x02,
LOG_ODELAY : 0x04,
LOG_NDELAY : 0x08,
LOG_NOWAIT : 0x10,
LOG_PERROR : 0x20,
/*
* priorities
*/
LOG_EMERG : 0,
LOG_ALERT : 1,
LOG_CRIT : 2,
LOG_ERR : 3,
LOG_WARNING : 4,
LOG_NOTICE : 5,
LOG_INFO : 6,
LOG_DEBUG : 7
};
/*
* Attach destroy handling
*
* XXX(sam) consider using AtExit: joyent/node#e4a8d261
*/
process.on('exit', function() {
SyslogWrapper.close();
});