/[smeserver]/cdrom.image/sme9/updates/storage/storage_log.py
ViewVC logotype

Contents of /cdrom.image/sme9/updates/storage/storage_log.py

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Sun Dec 22 04:27:51 2013 UTC (10 years, 7 months ago) by wellsi
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
Content type: text/x-python
FILE REMOVED
anaconda updates now handled via patches

1 import logging
2 import anaconda_log
3 import inspect
4
5 def log_method_call(d, *args, **kwargs):
6 classname = d.__class__.__name__
7 stack = inspect.stack()
8 methodname = stack[1][3]
9
10 spaces = len(stack) * ' '
11 fmt = "%s%s.%s:"
12 fmt_args = [spaces, classname, methodname]
13
14 for arg in args:
15 fmt += " %s ;"
16 fmt_args.append(arg)
17
18 for k, v in kwargs.items():
19 fmt += " %s: %s ;"
20 fmt_args.extend([k, v])
21
22 logger.debug(fmt % tuple(fmt_args))
23
24
25 logger = logging.getLogger("storage")
26 logger.setLevel(logging.DEBUG)
27 anaconda_log.logger.addFileHandler("/tmp/storage.log", logger, logging.DEBUG)
28 anaconda_log.logger.addFileHandler("/dev/tty3", logger, logging.DEBUG)

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed