diff --git a/volatility/cli/__init__.py b/volatility/cli/__init__.py index 0dc77f0af..6e1b7fc27 100644 --- a/volatility/cli/__init__.py +++ b/volatility/cli/__init__.py @@ -10,8 +10,17 @@ from volatility.framework.renderers.text import TextRenderer __author__ = 'mike' -logging.basicConfig(filename = 'example.log', level = logging.DEBUG) -logger = logging.getLogger("volatility") +logging.basicConfig(filename = 'example.log', + format = '%(asctime)s %(name)-12s %(levelname)-8s %(message)s', + datefmt = '%m-%d %H:%M', + level = logging.DEBUG) +vollog = logging.getLogger("volatility") +console = logging.StreamHandler() +console.setLevel(logging.DEBUG) +formatter = logging.Formatter('%(levelname)-8s %(name)-12s: %(message)s') +console.setFormatter(formatter) + +logging.getLogger("").addHandler(console) class CommandLine(object): diff --git a/volatility/framework/__init__.py b/volatility/framework/__init__.py index 81e31cb39..61834592e 100644 --- a/volatility/framework/__init__.py +++ b/volatility/framework/__init__.py @@ -13,12 +13,16 @@ import inspect # 2. If the interface has changed, increment current, set revision to 0 # 3. If only additions to the interface have been made, increment age # 4. If changes or removals of the interface have been made, set age to 0 +import logging +import os import sys CURRENT = 4 # Number of releases of the library with any change REVISION = 0 # Number of changes that don't affect the interface AGE = 0 # Number of consecutive versions of the interface the current version supports +vollog = logging.getLogger("volatility") + def version(): """Provides the so version number of the library""" diff --git a/volatility/framework/configuration/__init__.py b/volatility/framework/configuration/__init__.py index 8ee8fc364..0f8efe517 100644 --- a/volatility/framework/configuration/__init__.py +++ b/volatility/framework/configuration/__init__.py @@ -5,9 +5,13 @@ Created on 7 May 2013 """ import collections import json +import logging +from volatility.framework.configuration.requirements import MultiRequirement from volatility.framework.interfaces.configuration import CONFIG_SEPARATOR +vollog = logging.getLogger(__name__) + class HierarchicalDict(collections.Mapping): def __init__(self, initial_dict = None, separator = CONFIG_SEPARATOR): diff --git a/volatility/framework/configuration/requirements.py b/volatility/framework/configuration/requirements.py index 6b1f7e6c7..dacd04cd9 100644 --- a/volatility/framework/configuration/requirements.py +++ b/volatility/framework/configuration/requirements.py @@ -1,3 +1,6 @@ +import logging +import sys + from volatility.framework.interfaces import configuration as config_interface @@ -6,7 +9,9 @@ class InstanceRequirement(config_interface.RequirementInterface): def validate(self, value, _context): if not isinstance(value, self.instance_type): - raise TypeError(self.name + " input only accepts " + self.instance_type.__name__ + " type") + vollog.debug("TypeError - " + self.name + " input only accepts " + self.instance_type.__name__ + " type") + return False + return True class IntRequirement(InstanceRequirement):