aboutsummaryrefslogtreecommitdiffstats
path: root/logs.py
diff options
context:
space:
mode:
authorGravatar Christopher Baklid <[email protected]>2018-05-26 12:54:49 +0200
committerGravatar Christopher Baklid <[email protected]>2018-05-26 12:54:49 +0200
commitea2141dc6fd7284e6f9fa04ee638460286e3b09c (patch)
tree218d332be80bd2f4e177b0d9e4725dd27dec2034 /logs.py
parentlint (diff)
simplify threads and use local thread variables to manage user websocket connections
Diffstat (limited to 'logs.py')
-rw-r--r--logs.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/logs.py b/logs.py
new file mode 100644
index 0000000..fc6070e
--- /dev/null
+++ b/logs.py
@@ -0,0 +1,10 @@
+import logging
+import sys
+
+logformat = logging.Formatter(fmt='[%(asctime)s] [%(process)s] [%(levelname)s] %(message)s',
+ datefmt='%Y-%m-%d %H:%M:%S %z')
+log = logging.getLogger(__name__)
+log.setLevel(logging.DEBUG)
+console = logging.StreamHandler(sys.stdout)
+console.setFormatter(logformat)
+log.addHandler(console)