feat: 增加bash脚本,增加logging配置文件示例
This commit is contained in:
parent
f89729e13f
commit
986706f497
4
.gitignore
vendored
4
.gitignore
vendored
@ -137,8 +137,12 @@ dmypy.json
|
||||
# 避免上传配置文件
|
||||
config/*.json
|
||||
config/*.yaml
|
||||
config/*.ini
|
||||
|
||||
# push配置
|
||||
config/push.ini
|
||||
.DS_Store
|
||||
yaml/
|
||||
|
||||
# 日志文件
|
||||
*.log
|
||||
|
44
config/logging.ini.example
Normal file
44
config/logging.ini.example
Normal file
@ -0,0 +1,44 @@
|
||||
[loggers]
|
||||
keys=root,AutoMihoyoBBS
|
||||
|
||||
[handlers]
|
||||
keys=fileHandler,consoleHandler
|
||||
|
||||
[formatters]
|
||||
keys=simpleFormatter
|
||||
|
||||
; 缺少root logger会报错
|
||||
[logger_root]
|
||||
level=DEBUG
|
||||
handlers=fileHandler,consoleHandler
|
||||
|
||||
[logger_AutoMihoyoBBS]
|
||||
level=WARNING
|
||||
handlers=fileHandler,consoleHandler
|
||||
|
||||
; console
|
||||
[handler_consoleHandler]
|
||||
class=StreamHandler
|
||||
args=(sys.stdout,)
|
||||
level=DEBUG
|
||||
formatter=simpleFormatter
|
||||
|
||||
; file
|
||||
[handler_fileHandler]
|
||||
class=FileHandler
|
||||
args=('logging.log', 'a')
|
||||
level=DEBUG
|
||||
formatter=simpleFormatter
|
||||
|
||||
; 由于官方的SMTPHandler似乎不支持ssl邮箱,暂时不使用
|
||||
; Email
|
||||
; [handler_SMTPHandler]
|
||||
; class=handlers.SMTPHandler
|
||||
; ; logging.handlers.SMTPHandler(mailhost,fromaddr,toaddrs,subject,credentials = None,secure = None,timeout = 1.0)
|
||||
; args=()
|
||||
; level=ERROR
|
||||
; formatter=simpleFormatter
|
||||
|
||||
[formatter_simpleFormatter]
|
||||
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
|
||||
datefmt=%Y-%m-%dT%H:%M:%S
|
6
start.bash
Executable file
6
start.bash
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
# 进入脚本所在目录
|
||||
cd $(cd `dirname $0`;pwd)
|
||||
# 随机延时$RANDOM值为1~32767
|
||||
sleep $[$RANDOM%1200];
|
||||
python ./main.py;
|
Loading…
Reference in New Issue
Block a user