You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@heron.apache.org by hu...@apache.org on 2021/09/30 18:32:17 UTC

[incubator-heron] branch master updated: updatelogging (#3718)

This is an automated email from the ASF dual-hosted git repository.

huijun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git


The following commit(s) were added to refs/heads/master by this push:
     new 2190502  updatelogging (#3718)
2190502 is described below

commit 2190502da0ad723db86a13216f5d9acd0b4c6474
Author: Huijun Wu <hu...@users.noreply.github.com>
AuthorDate: Thu Sep 30 11:32:07 2021 -0700

    updatelogging (#3718)
    
    Co-authored-by: Huijun Wu <hu...@twitter.com>
---
 heron/shell/src/python/handlers/downloadhandler.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/heron/shell/src/python/handlers/downloadhandler.py b/heron/shell/src/python/handlers/downloadhandler.py
index 20e6adf..3186253 100644
--- a/heron/shell/src/python/handlers/downloadhandler.py
+++ b/heron/shell/src/python/handlers/downloadhandler.py
@@ -23,6 +23,7 @@
 import os
 import logging
 import tornado.web
+import anticrlf
 
 from heron.shell.src.python import utils
 
@@ -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