From 825e6940323251052b6a5f78b48ab3e8fa98e5d2 Mon Sep 17 00:00:00 2001 From: longfengpili <398745129@qq.com> Date: Thu, 20 Jan 2022 10:16:06 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BC=98=E5=8C=96]log=20dateformat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pydbapi/conf/settings.py | 8 ++++---- pydbapi/db/base.py | 2 +- setup.py | 4 ++-- tests/sqlite/sqlite.sql | 5 +++-- tests/sqlite/sqlite_test.py | 5 ++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pydbapi/conf/settings.py b/pydbapi/conf/settings.py index 9be93a1..79994ee 100644 --- a/pydbapi/conf/settings.py +++ b/pydbapi/conf/settings.py @@ -1,7 +1,7 @@ # @Author: chunyang.xu # @Email: 398745129@qq.com # @Date: 2020-06-10 14:14:53 -# @Last Modified time: 2021-11-16 17:34:45 +# @Last Modified time: 2022-01-20 09:47:50 # @github: https://github.com/longfengpili # !/usr/bin/env python3 @@ -26,12 +26,12 @@ 'formatters': { # 详细的日志格式 'standard': { - 'format': '%(asctime)s - %(threadName)s:%(thread)d - %(name)s - %(levelname)s - %(pathname)s - %(lineno)d - %(message)s', + 'format': '%(asctime)s.%(msecs)03d - %(threadName)s:%(thread)d - %(name)s - %(levelname)s - %(pathname)s - %(lineno)d - %(message)s', 'datefmt': '%Y-%m-%d %H:%M:%S', }, # 简单的日志格式 'simple': { - 'format': '%(asctime)s - %(threadName)s - %(name)s - %(levelname)s - %(filename)s - %(lineno)d - %(message)s', + 'format': '%(asctime)s.%(msecs)03d - %(threadName)s - %(name)s - %(levelname)s - %(filename)s - %(lineno)d - %(message)s', 'datefmt': '%Y-%m-%d %H:%M:%S', }, # 定义一个特殊的日志格式 @@ -41,7 +41,7 @@ # color 'color': { '()': colorlog.ColoredFormatter, - 'format': '%(asctime)s - %(threadName)s - %(name)s - %(levelname)s - %(filename)s - %(lineno)d - %(log_color)s%(message)s', + 'format': '%(asctime)s.%(msecs)03d - %(threadName)s - %(name)s - %(levelname)s - %(filename)s - %(lineno)d - %(log_color)s%(message)s', 'datefmt': '%Y-%m-%d %H:%M:%S', 'log_colors': { 'CRITICAL': 'bold_red', diff --git a/pydbapi/db/base.py b/pydbapi/db/base.py index 3c1ded5..e9f388d 100644 --- a/pydbapi/db/base.py +++ b/pydbapi/db/base.py @@ -1,7 +1,7 @@ # @Author: chunyang.xu # @Email: 398745129@qq.com # @Date: 2020-06-02 18:46:58 -# @Last Modified time: 2021-09-06 11:58:47 +# @Last Modified time: 2022-01-20 10:00:10 # @github: https://github.com/longfengpili # !/usr/bin/env python3 diff --git a/setup.py b/setup.py index 775c576..feeee37 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ # @Author: chunyang.xu # @Email: 398745129@qq.com # @Date: 2020-06-09 16:46:54 -# @Last Modified time: 2021-12-30 19:28:57 +# @Last Modified time: 2022-01-20 10:15:32 # @github: https://github.com/longfengpili # !/usr/bin/env python3 @@ -12,7 +12,7 @@ import shutil import setuptools -VERSION = '0.0.83' +VERSION = '0.0.84' PROJECT_NAME = 'pydbapi' with open('README.md', 'r', encoding='utf-8') as f: diff --git a/tests/sqlite/sqlite.sql b/tests/sqlite/sqlite.sql index 8913d88..96ee674 100644 --- a/tests/sqlite/sqlite.sql +++ b/tests/sqlite/sqlite.sql @@ -2,7 +2,7 @@ * @Author: chunyang.xu * @Date: 2020-06-04 17:57:10 * @Email: 398745129@qq.com -* @Last Modified time: 2021-09-23 11:45:59 +* @Last Modified time: 2022-01-20 09:55:34 */ #【arguments】# @@ -41,6 +41,7 @@ select * from table; drop table if exists temp_xu; --create测试我的测试 +create table if not exists temp_xu as select * from temp_events_ev; ### @@ -67,7 +68,7 @@ from test_xu ### ---【bmsn jp index verbose1 epass】 +--【bmsn jp index verbose1】 -- drop drop index multiple_index on temp_xu; -- create diff --git a/tests/sqlite/sqlite_test.py b/tests/sqlite/sqlite_test.py index 2aa0cf4..d324e76 100644 --- a/tests/sqlite/sqlite_test.py +++ b/tests/sqlite/sqlite_test.py @@ -1,7 +1,7 @@ # @Author: chunyang.xu # @Email: 398745129@qq.com # @Date: 2020-06-03 15:58:41 -# @Last Modified time: 2021-11-22 14:34:29 +# @Last Modified time: 2022-01-20 10:14:43 # @github: https://github.com/longfengpili # !/usr/bin/env python3 @@ -91,7 +91,7 @@ def test_addcol(self): def test_execfile(self): dirpath = os.path.dirname(os.path.abspath(__file__)) filepath = os.path.join(dirpath, 'sqlite.sql') - self.sqlite.file_exec(filepath, name='pizza', ehandling='raises', verbose=0) + self.sqlite.file_exec(filepath, name='pizza', ehandling='raises', verbose=0) # raise的时候才会报错 def test_get_instance(self): # sqlite1 = SqliteDB.get_instance() @@ -105,7 +105,6 @@ def test_get_instance(self): # result = eval(f"sqlite4.{i}") # print(f"【{i}】: {result}") - def test_verbose(self): sqlite = SqliteDB(database=None) sql = 'select * from test_xu;'