1
ivenvd 2013-12-10 04:15:15 +08:00
为啥要用整数表示呢,可以直接用 logging.debug() 之类的函数吧……
非要用的话可以用 logging.DEBUG …… |
2
zhangxiao 2013-12-10 05:27:27 +08:00
|
3
zhangxiao 2013-12-10 05:30:38 +08:00
不知道有没有整型的标准,不过不妨把kern_levels.h里定义的字符串当成hex值来看
|
4
efi 2013-12-10 06:56:59 +08:00 5
|
6
GTim 2013-12-10 09:03:26 +08:00
另外 php的error也不错
|
7
thbourlove 2013-12-10 10:52:03 +08:00
|
8
ms2008 2013-12-10 11:04:35 +08:00
@thbourlove
这个前面是基于RFC2119,是规定 RFC 本身的用语,并不符合楼主的需求。而后面虽然也有LogLevel,但都是一些字符常数,目测也是根据RFC5424或RFC3164而来... |
10
Muninn 2013-12-10 11:32:51 +08:00
679 # from <linux/sys/syslog.h>:
680 # ====================================================================== 681 # priorities/facilities are encoded into a single 32-bit quantity, where 682 # the bottom 3 bits are the priority (0-7) and the top 28 bits are the 683 # facility (0-big number). Both the priorities and the facilities map 684 # roughly one-to-one to strings in the syslogd(8) source code. This 685 # mapping is included in this file. 686 # 687 # priorities (these are ordered) 688 689 LOG_EMERG = 0 # system is unusable 690 LOG_ALERT = 1 # action must be taken immediately 691 LOG_CRIT = 2 # critical conditions 692 LOG_ERR = 3 # error conditions 693 LOG_WARNING = 4 # warning conditions 694 LOG_NOTICE = 5 # normal but significant condition 695 LOG_INFO = 6 # informational 696 LOG_DEBUG = 7 # debug-level messages python的源码里也是一致的. |
11
hhkbp2 2013-12-10 11:41:43 +08:00
整数不标准,不过名字很通用,用法都一样
|