git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
a little nicer wrt pep8
[sfa.git]
/
sfa
/
util
/
sfalogging.py
diff --git
a/sfa/util/sfalogging.py
b/sfa/util/sfalogging.py
index
80d8b3f
..
9afc334
100644
(file)
--- a/
sfa/util/sfalogging.py
+++ b/
sfa/util/sfalogging.py
@@
-1,4
+1,4
@@
-#!/usr/bin/
python
+#!/usr/bin/
env python3
"""
A reroutable logger that can handle deep tracebacks
"""
A reroutable logger that can handle deep tracebacks
@@
-34,7
+34,7
@@
Implementation:
# pylint: disable=c0111, c0103, w1201
# pylint: disable=c0111, c0103, w1201
-from __future__ import print_function
+
import os
import os.path
import os
import os.path
@@
-121,8
+121,9
@@
logging.setLoggerClass(SfaLogger)
# have the same set of keys
def logging_config(context):
if context == 'server':
# have the same set of keys
def logging_config(context):
if context == 'server':
- handlername = 'file'
- filename = '/var/log/sfa.log'
+ # use stdout and let journalctl do the heavy lifting
+ handlername = 'stdout'
+ #filename = '/var/log/sfa.log'
level = 'DEBUG'
elif context == 'import':
handlername = 'file'
level = 'DEBUG'
elif context == 'import':
handlername = 'file'
@@
-134,7
+135,7
@@
def logging_config(context):
level = 'DEBUG'
elif context == 'console':
handlername = 'stdout'
level = 'DEBUG'
elif context == 'console':
handlername = 'stdout'
- filename = 'ignored'
+
#
filename = 'ignored'
level = 'INFO'
else:
print("Cannot configure logging - exiting")
level = 'INFO'
else:
print("Cannot configure logging - exiting")