/usr/share/pyshared/arcom/logger.py is in nordugrid-arc-python 1.1.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | import arc
import traceback
log_levels = [arc.DEBUG, arc.VERBOSE, arc.INFO, arc.WARNING, arc.ERROR, arc.FATAL]
def get_logger(system = '<UNKNOWN>'):
return Logger(arc.Logger(arc.Logger_getRootLogger(), system))
class Logger:
def __init__(self, logger):
self.logger = logger
def msg(self, *args):
"""docstring for log"""
# initializing logging facility
args = list(args)
if not args:
severity = arc.VERBOSE
elif args[0] in log_levels:
severity = args.pop(0)
else:
severity = arc.VERBOSE
if not args:
args = ['Python exception:\n', traceback.format_exc()]
severity = arc.ERROR
mesg = ' '.join([str(arg) for arg in args])
self.logger.msg(severity, mesg)
return mesg
|