You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2020/11/25 16:12:28 UTC

[skywalking-python] branch master updated: chore: stop propagating logs to avoid logging twice and adjust log format (#90)

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

kezhenxu94 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-python.git


The following commit(s) were added to refs/heads/master by this push:
     new 0d85499  chore: stop propagating logs to avoid logging twice and adjust log format (#90)
0d85499 is described below

commit 0d85499d309523def1426981630a1c89d564a342
Author: Zhenxu Ke <ke...@apache.org>
AuthorDate: Thu Nov 26 00:12:18 2020 +0800

    chore: stop propagating logs to avoid logging twice and adjust log format (#90)
    
    * chore: stop propagate logs to avoid logging twice and adjust log format
    
    * also add 3.9 to build matrix
---
 .github/workflows/build.yaml | 2 +-
 skywalking/loggings.py       | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 69d871c..e9df9e5 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -28,7 +28,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        python-version: [3.5, 3.6, 3.7, 3.8]
+        python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
       fail-fast: false
     steps:
       - name: Checkout source codes
diff --git a/skywalking/loggings.py b/skywalking/loggings.py
index 395abe1..55289ef 100644
--- a/skywalking/loggings.py
+++ b/skywalking/loggings.py
@@ -23,9 +23,10 @@ from skywalking import config
 def getLogger(name=None):
     logger = logging.getLogger(name)
     ch = logging.StreamHandler()
-    formatter = logging.Formatter('%(name)-32s [%(threadName)-15s] [%(levelname)-8s] %(message)s')
+    formatter = logging.Formatter('%(name)s [%(threadName)s] [%(levelname)s] %(message)s')
     ch.setFormatter(formatter)
     logger.addHandler(ch)
+    logger.propagate = False
 
     return logger