From 7f478a0abb2a4edc02d9df0e9f81d19e19e4ab7c Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Sat, 18 Nov 2023 23:36:04 +0800 Subject: [PATCH] =?UTF-8?q?enhance:=20=E6=9B=B4=E6=94=B9=20readme.md=20?= =?UTF-8?q?=E5=92=8C=20pyproject.toml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 38 ++++++++++++++++++++++++++++++++++---- pyproject.toml | 1 - 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 104cb8a..994b36c 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,9 @@ A python lib came from [Difficult Rocket](https://github.com/shenjackyuanjie/Dif - Version / 版本: 0.2.0-alpha0 - Author / 作者: shenjackyuanjie 3695888@qq.com -> [shenjackyuanjie](https://github/shenjackyuanjie) +> [shenjackyuanjie](https://github.com/shenjackyuanjie) + +> [更新日志|Change Log](docs/change_log.md) ### License/许可证 @@ -17,18 +19,46 @@ A python lib came from [Difficult Rocket](https://github.com/shenjackyuanjie/Dif ## 安装/Install -```bash +```bash title="install.sh" pip install lib-not-dr ``` ## 使用/Usage +### Logger + +> WIP +> 等待 0.2.0 + +```python title="logger.py" +from lib_not_dr.logger.logger import Logger + +logger = Logger.get_logger_by_name("test") + +logger.fine('Hello World!') +logger.debug('Hello World!') +logger.trace('Hello tracing!') +logger.info('Hello World!') # info! +logger.warn('warnnnnnnn') +logger.error('Hello World!') +logger.fatal('good bye world') + +# tag +logger.info('this message if from tag', tag='test') +logger.debug('this debug log if from admin', tag='admin') + +# end +logger.debug('and this message ends with none', end=' ') +logger.trace('so this message will be in the same line', tag='same line!') +``` + + ### Nuitka Compiler Helper > simple example > 简单示例 -```python +```python title="simple_nuitka.py" import subprocess from pathlib import Path from lib_not_dr.nuitka.compile import CompilerHelper @@ -42,7 +72,7 @@ subprocess.run(compiler.gen_subprocess_cmd()) > more complex example > 复杂示例 -```python +```python title="complex_nuitka.py" import sys import subprocess from pathlib import Path diff --git a/pyproject.toml b/pyproject.toml index 36f41e8..1ae451a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,4 +25,3 @@ line-length = 150 src = [ "lib_not_dr" ] -format = "grouped" \ No newline at end of file