ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tools
PyJobTransforms
python
trfLogger.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
2
3
14
15
import
logging
16
import
logging.config
as
lconfig
17
import
os
18
import
sys
19
20
23
msg = logging.getLogger(
'PyJobTransforms'
)
24
25
27
stdLogLevels = {
'DEBUG'
: logging.DEBUG,
28
'VERBOSE'
: logging.DEBUG,
29
'INFO'
: logging.INFO,
30
'WARNING'
: logging.WARNING,
31
'ERROR'
: logging.ERROR,
32
'CRITICAL'
: logging.CRITICAL,
33
'FATAL'
: logging.CRITICAL,
34
'CATASTROPHE'
: logging.CRITICAL+10,
# Special prority level to ensure an error is
35
# elevated to be the exitMsg
36
}
37
38
39
stdLogLevelsByCritcality = [
'FATAL'
,
'CRITICAL'
,
'ERROR'
,
'WARNING'
,
'INFO'
,
'VERBOSE'
,
'DEBUG'
]
40
41
# If TRF_LOGCONF is defined then try to use that file
42
# for logging setup
43
if
'TRF_LOGCONF'
in
os.environ
and
os.access(os.environ[
'TRF_LOGCONF'
], os.R_OK):
44
lconfig.fileConfig(os.environ[
'TRF_LOGCONF'
])
45
else
:
46
# Otherwise use a standard logging configuration
47
hdlr = logging.StreamHandler(sys.stdout)
48
# asctime seems too verbose...?
49
frmt = logging.Formatter(
"%(name)s.%(funcName)s %(asctime)s %(levelname)s %(message)s"
)
50
# frmt = logging.Formatter("Trf:%(name)s.%(funcName)s %(levelname)s %(message)s")
51
hdlr.setFormatter(frmt)
52
msg.addHandler(hdlr)
53
msg.setLevel(logging.INFO)
54
55
56
def
setRootLoggerLevel
(level):
57
msg.setLevel(level)
python.trfLogger.setRootLoggerLevel
setRootLoggerLevel(level)
Change the loggging level of the root logger.
Definition
trfLogger.py:56
Generated on
for ATLAS Offline Software by
1.17.0