cute-log - A lightweight, flxiable, high configurable, thread-safe and cute logging library - Google Project Hosting
2013-01-02 12:50
816 查看
cute-log - A lightweight, flxiable, high configurable, thread-safe and cute logging library - Google Project Hosting
日志模块与输出模块相互独立,可以是N:N的关系(比如,一个日志模块可以输出到独立的文件中)
文件输出模式可以按照轮转、周期、文件大小来控制输出日志的数量
日志模块之间可以是继承关系,采用.来确定关系,一些模块属性也会从父模块中继承到子模块中
日志记录输出类型有多种,详见root.__type__, 各类型之间是"或"的关系,并能随着继承关系传递,到子模块
配置文件可以实时修改,即时生效,无需重启应用程序
支持终端彩色输出
可根据函数调用栈分级输出日志,方便查看函数的调用次序
![](http://life.chinaunix.net/bbsfile/month_0809/20080901_f5329387f1907b86dcf0fWOlrziDRoxe.jpg)
Features:
日志服务模块化,每个模块可以共享使用日志模块与输出模块相互独立,可以是N:N的关系(比如,一个日志模块可以输出到独立的文件中)
文件输出模式可以按照轮转、周期、文件大小来控制输出日志的数量
日志模块之间可以是继承关系,采用.来确定关系,一些模块属性也会从父模块中继承到子模块中
日志记录输出类型有多种,详见root.__type__, 各类型之间是"或"的关系,并能随着继承关系传递,到子模块
配置文件可以实时修改,即时生效,无需重启应用程序
支持终端彩色输出
可根据函数调用栈分级输出日志,方便查看函数的调用次序
![](http://life.chinaunix.net/bbsfile/month_0809/20080901_f5329387f1907b86dcf0fWOlrziDRoxe.jpg)
配置文件模板
[global] # Global configure. # Logger accesses this config-file per <check_config_interval>, # that will reload this config-file that be modified and validate # the new strategy. # The 'interval' is by Second Unit if the last charactor is 's/S', # on 'm/M' by minute, others are not supported(default is 's'). check_config_interval = 5s [screen_output] # ouput configure. # Support : STDOUT,FILES,SHUTDOWN type = shutdown [file_output] # ouput configure. # Support : STDOUT,FILES,SHUTDOWN type = FILES # Log file name name = http dir = ./log # Single file size. # The 'size' is by MBytes Unit if the last charactor is 'M', # on 'K' by KBytes, others do not supported(default is 'M'). # If value is ''(null), the file size is unlimited. # Default value is 1M single_file_size = 2M # Max index of rolloever. # For example : <rolloever> = 5 # 2008-08-08.log(current), 2008-08-08.log.1, 2008-08-08.log.2, # 2008-08-08.log.3, 2008-08-08.log.4, 2008-08-08.log.5(lasted). # Default value is 0 rolloever = 5 # Support : Seconds. # How long create a new log file. # If value is ''(null), this abbtribute will be disable. # Default value is 0 generate_file_period = [modules] ## # Support : ALLS|TRACE|DEBUG|WNING|ERROR|RINFO|FATAL|SHUTDOWN # Log type is hereditable, all of modules inherit from <root> # If value is ''(null), the root has not strategy. # Don't delete this attribute !!!. root.__type__ = ERROR|RINFO # Example : # http_server = TRACE|RINFO # actually is root.http_server # http_server.request = DEBUG # ftp_server.download = RINFO|FATAL # If you want to close the logger of this module, you must type `SHUTDOWN' # and not ''. # ftp_server.upload = SHUTDOWN # If value is ''(null), the module's configure inherits from its parent # Mode of log-msg be output # If value is ''(null), the output default set to `NULL' root.__output__ = file_output # Max length of one log record(not include format string!!), Bytes Unit # Default value is 511 root.__max_len_of_one_record__ = 1023 ## end # user's log modules # example: root.main.__type__ = DEBUG|TRACE root.main.__output__ = root.main.test.__type__ = TRACE root.main.test.sub.__type__ = WNING root.main.test.sub.__output__ = screen_output,~file_output root.main.test.sub.sub_1.__type__ = WNING root.main.test.sub.sub_2.__type__ = WNING root.main.test.sub.sub_3.__type__ = WNING root.main.test.sub.sub_4.__type__ = WNING如遇问题请发到 shaovie@gmail.com
相关文章推荐
- google-glog - Logging library for C++ - Google Project Hosting
- python-segment - segmentation and classify library written by python - Google Project Hosting
- google-glog - Logging library for C++ - Google Project Hosting
- gperftools - Fast, multi-threaded malloc() and nifty performance analysis tools - Google Project Hosting
- duibrowser - a cross-platform and light-weight webkit kernel web browser - Google Project Hosting
- pacparser - A library to make your web software pac (proxy auto-config) files intelligent. Comes with much useful pactester tool now. - Google Project Hosting
- spserver - SPServer is a high concurrency server framework library written on C++ - Google Project Hosting
- psutil - A cross-platform process and system utilities module for Python - Google Project Hosting
- xrelayer - A lightweight HTTP proxy written in C++ - Google Project Hosting
- create log by common-logging and log4j in java project
- Customization - harviewer - Visualise HTTP Archive log files. - Google Project Hosting
- miniz - Single C source file Deflate/Inflate compression library with zlib-compatible API, ZIP archive reading/writing, PNG writing - Google Project Hosting
- This function has none of Deterministic,no sql,or reads sql data in its declaration and binary logging is enabled(you *might* want to use the less safe log_bin_trust_function_creators variable
- pykoala - A simple, small and fast web crawler - Google Project Hosting
- scipy-cluster - An extension to Scipy for generating, visualizing, and analyzing hierarchical clusters. - Google Project Hosting
- templatemaker - Python library for extracting data from similarly formatted text strings. - Google Project Hosting
- aranduka - A simple e-book manager and reader - Google Project Hosting
- libibase - 实时增量全文检索搜索引擎系统(Instant and Incremental Full-Text Search Engine) - Google Project Hosting
- py-webkit-html-manipulator - Server side rendering, extraction and manipulation of HTML over HTTP. - Google Project Hosting
- libibase - 实时增量全文检索搜索引擎系统(Instant and Incremental Full-Text Search Engine) - Google Project Hosting