1 Star 0 Fork 0

abel/byte-of-python

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
stdlib_logging.py 629 Bytes
一键复制 编辑 原始数据 按行查看 历史
Swaroop C H 提交于 2016-01-19 23:47 +08:00 . Add programs folder
import os
import platform
import logging
if platform.platform().startswith('Windows'):
logging_file = os.path.join(os.getenv('HOMEDRIVE'),
os.getenv('HOMEPATH'),
'test.log')
else:
logging_file = os.path.join(os.getenv('HOME'),
'test.log')
print("Logging to", logging_file)
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s : %(levelname)s : %(message)s',
filename=logging_file,
filemode='w',
)
logging.debug("Start of the program")
logging.info("Doing something")
logging.warning("Dying now")
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/PythonIoT/byte-of-python.git
git@gitee.com:PythonIoT/byte-of-python.git
PythonIoT
byte-of-python
byte-of-python
master

搜索帮助