Improve log levels and distribution of messages.

This commit is contained in:
Mike Auty
2019-09-26 21:16:12 +01:00
parent 211ad0d524
commit ae010a2390
4 changed files with 10 additions and 7 deletions
+2 -2
View File
@@ -164,8 +164,8 @@ class CommandLine(interfaces.plugins.FileConsumerInterface):
else:
console.setLevel(10 - (partial_args.verbosity - 2))
vollog.debug("Volatility plugins path: {}".format(volatility.plugins.__path__))
vollog.debug("Volatility symbols path: {}".format(volatility.symbols.__path__))
vollog.info("Volatility plugins path: {}".format(volatility.plugins.__path__))
vollog.info("Volatility symbols path: {}".format(volatility.symbols.__path__))
# Set the PARALLELISM
if partial_args.parallelism == 'processes':
+3
View File
@@ -108,6 +108,9 @@ class VolShell(cli.CommandLine):
volatility.symbols.__path__ = [os.path.abspath(p)
for p in partial_args.symbol_dirs.split(";")] + constants.SYMBOL_BASEPATHS
vollog.info("Volatility plugins path: {}".format(volatility.plugins.__path__))
vollog.info("Volatility symbols path: {}".format(volatility.symbols.__path__))
if partial_args.log:
file_logger = logging.FileHandler(partial_args.log)
file_logger.setLevel(0)
+2 -2
View File
@@ -114,11 +114,11 @@ class LayerStacker(interfaces.automagic.AutomagicInterface):
for stacker_cls in stack_set:
stacker = stacker_cls()
try:
vollog.log(constants.LOGLEVEL_VVVV, "Attempting to stack using {}".format(stacker_cls.__name__))
vollog.log(constants.LOGLEVEL_VV, "Attempting to stack using {}".format(stacker_cls.__name__))
new_layer = stacker.stack(new_context, current_layer_name, progress_callback)
if new_layer:
new_context.layers.add_layer(new_layer)
vollog.log(constants.LOGLEVEL_VVVV,
vollog.log(constants.LOGLEVEL_VV,
"Stacked {} using {}".format(new_layer.name, stacker_cls.__name__))
break
except Exception as excp:
@@ -45,7 +45,7 @@ class SymbolBannerCache(interfaces.automagic.AutomagicInterface):
for path in banners[banner]:
url = urllib.parse.urlparse(path)
if url.scheme == 'file' and not os.path.exists(urllib.request.url2pathname(url.path)):
vollog.log(constants.LOGLEVEL_V,
vollog.log(constants.LOGLEVEL_VV,
"Removing cached path {} for banner {}: file does not exist".format(path, banner))
banners[banner].remove(path)
# This is probably excessive, but it's here if we need it
@@ -53,7 +53,7 @@ class SymbolBannerCache(interfaces.automagic.AutomagicInterface):
# zip_file, zip_path = url.path.split("!")
# zip_file = urllib.parse.urlparse(zip_file).path
# if ((not os.path.exists(zip_file)) or (zip_path not in zipfile.ZipFile(zip_file).namelist())):
# vollog.log(constants.LOGLEVEL_V,
# vollog.log(constants.LOGLEVEL_VV,
# "Removing cached path {} for banner {}: file does not exist".format(path, banner))
# banners[banner].remove(path)
@@ -102,7 +102,7 @@ class SymbolBannerCache(interfaces.automagic.AutomagicInterface):
# We don't bother with the hash (it'll likely take too long to validate)
# but we should check at least that the banner matches on load.
banner = isf.get_symbol(self.symbol_name).constant_data
vollog.log(constants.LOGLEVEL_V, "Caching banner {} for file {}".format(banner, isf_url))
vollog.log(constants.LOGLEVEL_VV, "Caching banner {} for file {}".format(banner, isf_url))
bannerlist = banners.get(banner, [])
bannerlist.append(isf_url)