1
2
3
4
5
6
7
8
9
10
11
12
13
14 LOG_EMERGENCY = 0
15 LOG_ALERT = 1
16 LOG_CRITICAL = 2
17 LOG_ERRROR = 3
18 LOG_WARNING = 4
19 LOG_NOTICE = 5
20 LOG_INFO = 6
21 LOG_DEBUG = 7
22
23 LOG_PRIMASK = 0x07
24
27
28 LOG_KERN = 0 << 3
29 LOG_USER = 1 << 3
30 LOG_MAIL = 2 << 3
31 LOG_DAEMON = 3 << 3
32 LOG_AUTH = 4 << 3
33 LOG_SYSLOG = 5 << 3
34 LOG_LPR = 6 << 3
35 LOG_NEWS = 7 << 3
36 LOG_UUCP = 8 << 3
37 LOG_CRON = 9 << 3
38 LOG_AUTHPRIV = 10 << 3
39 LOG_FTP = 11 << 3
40 LOG_LOCAL0 = 16 << 3
41 LOG_LOCAL1 = 17 << 3
42 LOG_LOCAL2 = 18 << 3
43 LOG_LOCAL3 = 19 << 3
44 LOG_LOCAL4 = 20 << 3
45 LOG_LOCAL5 = 21 << 3
46 LOG_LOCAL6 = 22 << 3
47 LOG_LOCAL7 = 23 << 3
48
49 LOG_NFACILITIES = 24
50 LOG_FACMASK = 0x03F8
52
54 -def LOG_UPTO(pri): return (1 << pri + 1) - 1
55
56
58
59 fac_values = {}
60 fac_names = {}
61 pri_values = {}
62 pri_names = {}
63 for i, j in globals().items():
64 if i[:4] == 'LOG_' and type(j) == type(0):
65 if j > LOG_PRIMASK or i == 'LOG_KERN':
66 n, v = fac_names, fac_values
67 else:
68 n, v = pri_names, pri_values
69 i = i[4:].lower()
70 v[i] = j
71 n[j] = i
72 del i, j, n, v
73