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

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

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


Revision 1.1 - (hide annotations) (download) (as text)
Tue Jul 30 21:01:52 2013 UTC (10 years, 11 months ago) by charliebrady
Branch: MAIN
Content type: text/x-python
Add storage module from anaconda to updates directory, so that parts of it can be modified.

1 charliebrady 1.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