mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-09 11:17:38 +02:00
Add in proper logging statements.
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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"""
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user