Skip to content

Commit

Permalink
updatelogging (apache#3718)
Browse files Browse the repository at this point in the history
Co-authored-by: Huijun Wu <huijunw@twitter.com>
  • Loading branch information
2 people authored and surahman committed Oct 30, 2021
1 parent a479e89 commit a5fc125
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion heron/shell/src/python/handlers/downloadhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import os
import logging
import tornado.web
import anticrlf

from heron.shell.src.python import utils

Expand All @@ -34,7 +35,14 @@ class DownloadHandler(tornado.web.RequestHandler):
def get(self, path):
""" get method """

logging.debug("request to download: %s", path)
handler = logging.StreamHandler()
handler.setFormatter(anticrlf.LogFormatter('%(levelname)s:%(name)s:%(message)s'))
logger = logging.getLogger(__name__)
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)

logger.debug("request to download: %s", path)

# If the file is large, we want to abandon downloading
# if user cancels the requests.
# pylint: disable=attribute-defined-outside-init
Expand Down

0 comments on commit a5fc125

Please sign in to comment.