开发者社区 问答 正文

python怎么打印日志

python怎么打印日志

展开
收起
云计算小粉 2018-05-10 20:11:03 1735 分享 版权
2 条回答
写回答
取消 提交回答
  • import logging

    简单打印日志举例

    logging.basicConfig(level=logging.DEBUG) # 设置日志级别,WARN
    logging.warning('Watch out!') # will print a message to the console
    logging.info('I told you so') # will not print anything

    2019-07-17 22:25:01
    赞同 展开评论
  • print("hello world")

    Do you mean this?

    2019-07-17 22:25:01
    赞同 展开评论
问答分类:
问答标签:
问答地址: