git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
autopep8
[plcapi.git]
/
PLC
/
Logger.py
diff --git
a/PLC/Logger.py
b/PLC/Logger.py
index
a48ac7d
..
aa2eb79
100644
(file)
--- a/
PLC/Logger.py
+++ b/
PLC/Logger.py
@@
-1,11
+1,17
@@
# pylint: disable=c0103
# pylint: disable=c0103
+import os
import logging
import logging.config
# we essentially need one all-purpose logger
# that goes into /var/log/plcapi.log
import logging
import logging.config
# we essentially need one all-purpose logger
# that goes into /var/log/plcapi.log
+# for debugging
+global_filename = "/var/log/plcapi.log"
+if 'PLCAPILOG' in os.environ:
+ global_filename = os.environ['PLCAPILOG']
+
plcapi_logging_config = {
'version': 1,
# IMPORTANT: we may be imported by something else, like sfa, so:
plcapi_logging_config = {
'version': 1,
# IMPORTANT: we may be imported by something else, like sfa, so:
@@
-19,7
+25,7
@@
plcapi_logging_config = {
},
'handlers': {
'plcapi': {
},
'handlers': {
'plcapi': {
- 'filename':
'/var/log/plcapi.log'
,
+ 'filename':
global_filename
,
'level': 'INFO',
'class': 'logging.FileHandler',
'formatter': 'standard',
'level': 'INFO',
'class': 'logging.FileHandler',
'formatter': 'standard',