Skip to content

Commit

Permalink
[优化]log dateformat
Browse files Browse the repository at this point in the history
  • Loading branch information
longfengpili committed Jan 20, 2022
1 parent 1e25d77 commit 825e694
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions pydbapi/conf/settings.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @Author: chunyang.xu
# @Email: [email protected]
# @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
Expand All @@ -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',
},
# 定义一个特殊的日志格式
Expand All @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion pydbapi/db/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @Author: chunyang.xu
# @Email: [email protected]
# @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
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @Author: chunyang.xu
# @Email: [email protected]
# @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
Expand All @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions tests/sqlite/sqlite.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: chunyang.xu
* @Date: 2020-06-04 17:57:10
* @Email: [email protected]
* @Last Modified time: 2021-09-23 11:45:59
* @Last Modified time: 2022-01-20 09:55:34
*/

#【arguments】#
Expand Down Expand Up @@ -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;
###

Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions tests/sqlite/sqlite_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @Author: chunyang.xu
# @Email: [email protected]
# @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
Expand Down Expand Up @@ -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()
Expand All @@ -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;'
Expand Down

0 comments on commit 825e694

Please sign in to comment.