# ilogger **Repository Path**: aidings/ilogger ## Basic Information - **Project Name**: ilogger - **Description**: 日志记录程序,支持本地和网络日志记录,多线程请使用dlogger类,多进程请使用do_server启动在线服务,后使用python系统的logging的模块即可 - **Primary Language**: Python - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2022-08-06 - **Last Updated**: 2022-10-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ilogger #### 介绍 日志记录程序,支持本地和网络日志记录,多线程请使用dlogger类,多进程请使用do_server启动在线服务,后使用python系统的logging的模块即可 #### 软件架构 - LocalLogger: 使用的是本地的循环记录log,按照天备份,最多保存15天的记录 - NetworkLogger: 使用TCP网络存储Logger,一般用于多进程中日志存储,按照天备份,做多从存储15天的记录 #### 安装教程 1. 使用稳定版本 前往https://gitee.com/cvding/ilogger主页下载release发行版本 2. 使用最新版本 `pip install git+https://gitee.com/cvding/ilogger.git` #### 使用说明 1. LocalLogger ```python from ilogger import LocalLogger app = LocalLogger(log_path='./', app_name='default', write_level='debug', print_level='info', show_info=True) app.info("this is log 1") app.debug("this is log 2") app.error("this is log 3) ``` 2. NetworkLogger - 使用`run_log`命令启动logger服务器 - 使用如下脚本写入日志 ```python from ilogger import NetworkLogger app = NetworkLogger(level='debug', host='localhost', port=logging.handlers.DEFAULT_TCP_LOGGING_PORT) log_root = app.create() log_app1 = app.create(name='app1') log_app2 = app.create(name='app2') log_root.info("this is log 1") log_app1.debug('this is log 2') log_app2.error('this is log 3') ``` #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request