Created
February 2, 2022 14:55
-
-
Save ouyen/c3be88478a4fda8c45294e6a6b13cb41 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import logging | |
# Log输出,这里提供了自定义logging输出的机会,只需要创建一个logging.ini并且写入配置文件即可自定义输出 | |
file_path = os.path.dirname(os.path.realpath(__file__)) + "/config/logging.ini" | |
if os.path.exists(file_path): | |
import logging.config | |
logging.config.fileConfig(file_path) | |
log = logging.getLogger("AutoMihoyoBBS") | |
else: | |
logging.basicConfig( | |
level=logging.INFO, | |
format='%(asctime)s %(levelname)s %(message)s', | |
datefmt='%Y-%m-%dT%H:%M:%S') | |
log = logger = logging |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment