<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ### 手動記錄 在控制器文件中使用 ``` #!/usr/bin/env python3 # -*- encoding: utf-8 -*- from app.api_1_0 import bp from flask import render_template, current_app @bp.route('/', methods=['GET']) def index(): pass @bp.route('/mylog') def logtest(): current_app.logger.debug("我是 debug 級別") current_app.logger.info("我是 info 級別") current_app.logger.warning("我是 warning 級別") current_app.logger.error("我是 error 級別") current_app.logger.critical("我是 critical 級別") try: num = 1/0 except ZeroDivisionError as e: current_app.logger.error("除數為 0") except Exception as e: current_app.logger("未知原因報錯") return '愿世界一切安好,程序永無BUG!!!' ``` 訪問測試 `root@airvip:~/python_app/flask-demo# curl 127.0.0.1:5000/api/v1.0/mylog` 我們可以在 `logs/log` 文件中查看到如下內容 ``` DEBUG index.py:20 我是 debug 級別 INFO index.py:21 我是 info 級別 WARNING index.py:22 我是 warning 級別 ERROR index.py:23 我是 error 級別 CRITICAL index.py:24 我是 critical 級別 ERROR index.py:29 除數為 0 INFO _internal.py:113 127.0.0.1 - - [30/Dec/2020 10:12:06] "GET /api/v1.0/mylog HTTP/1.1" 200 - ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看