summaryrefslogtreecommitdiffstats
path: root/pyanaconda/storage/storage_log.py
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2013-01-14 17:48:37 -0600
committerDavid Lehman <dlehman@redhat.com>2013-01-28 13:15:31 -0600
commit9040049d8d232eae3f0f51ffe442dbe49d273bce (patch)
tree5966597dd00948b4eae345a9dc8b509ebb0dab00 /pyanaconda/storage/storage_log.py
parente6c6261e1d7e912103ef1618e4a84c5f70abb00a (diff)
downloadanaconda-9040049d8d232eae3f0f51ffe442dbe49d273bce.tar.gz
anaconda-9040049d8d232eae3f0f51ffe442dbe49d273bce.tar.xz
anaconda-9040049d8d232eae3f0f51ffe442dbe49d273bce.zip
Remove the storage module and replace it with blivet.
Diffstat (limited to 'pyanaconda/storage/storage_log.py')
-rw-r--r--pyanaconda/storage/storage_log.py46
1 files changed, 0 insertions, 46 deletions
diff --git a/pyanaconda/storage/storage_log.py b/pyanaconda/storage/storage_log.py
deleted file mode 100644
index 62ad86fd2..000000000
--- a/pyanaconda/storage/storage_log.py
+++ /dev/null
@@ -1,46 +0,0 @@
-import inspect
-import logging
-
-log = logging.getLogger("storage")
-log.addHandler(logging.NullHandler())
-
-def function_name_and_depth():
- IGNORED_FUNCS = ["function_name_and_depth",
- "log_method_call",
- "log_method_return"]
- stack = inspect.stack()
-
- for i, frame in enumerate(stack):
- methodname = frame[3]
- if methodname not in IGNORED_FUNCS:
- return (methodname, len(stack) - i)
-
- return ("unknown function?", 0)
-
-def log_method_call(d, *args, **kwargs):
- classname = d.__class__.__name__
- (methodname, depth) = function_name_and_depth()
- spaces = depth * ' '
- fmt = "%s%s.%s:"
- fmt_args = [spaces, classname, methodname]
-
- for arg in args:
- fmt += " %s ;"
- fmt_args.append(arg)
-
- for k, v in kwargs.items():
- fmt += " %s: %s ;"
- if "pass" in k.lower() and v:
- v = "Skipped"
- fmt_args.extend([k, v])
-
- logging.getLogger("storage").debug(fmt % tuple(fmt_args))
-
-def log_method_return(d, retval):
- classname = d.__class__.__name__
- (methodname, depth) = function_name_and_depth()
- spaces = depth * ' '
- fmt = "%s%s.%s returned %s"
- fmt_args = (spaces, classname, methodname, retval)
- logging.getLogger("storage").debug(fmt % fmt_args)
-