Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1311)

Unified Diff: plaso/cli/image_export_tool.py

Issue 331400043: [plaso] Added CompressedFileHandler for logging #1549 (Closed)
Patch Set: Worked on tests Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | plaso/cli/log2timeline_tool.py » ('j') | plaso/lib/loggers.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: plaso/cli/image_export_tool.py
diff --git a/plaso/cli/image_export_tool.py b/plaso/cli/image_export_tool.py
index 2e32ce4604d6463408449108c876f74fa6069261..9e2ee58a82a4eb0a0618969b3ab24f4561be2dad 100644
--- a/plaso/cli/image_export_tool.py
+++ b/plaso/cli/image_export_tool.py
@@ -23,6 +23,7 @@ from plaso.engine import knowledge_base
from plaso.engine import path_helper
from plaso.filters import file_entry as file_entry_filters
from plaso.lib import errors
+from plaso.lib import loggers
from plaso.lib import specification
from plaso.preprocessors import manager as preprocess_manager
@@ -618,7 +619,7 @@ class ImageExportTool(storage_media_tool.StorageMediaTool):
Returns:
bool: True if the arguments were successfully parsed.
"""
- self._ConfigureLogging()
+ loggers.ConfigureLogging()
argument_parser = argparse.ArgumentParser(
description=self.DESCRIPTION, epilog=self.EPILOG, add_help=False,
@@ -675,6 +676,10 @@ class ImageExportTool(storage_media_tool.StorageMediaTool):
self._output_writer.Write(argument_parser.format_usage())
return False
+ loggers.ConfigureLogging(
+ debug_output=self._debug_mode, filename=self._log_file,
+ quiet_mode=self._quiet_mode)
+
return True
def ParseOptions(self, options):
@@ -704,21 +709,6 @@ class ImageExportTool(storage_media_tool.StorageMediaTool):
self._ParseStorageMediaOptions(options)
- format_string = (
- '%(asctime)s [%(levelname)s] (%(processName)-10s) PID:%(process)d '
- '<%(module)s> %(message)s')
-
- if self._debug_mode:
- logging_level = logging.DEBUG
- elif self._quiet_mode:
- logging_level = logging.WARNING
- else:
- logging_level = logging.INFO
-
- self._ConfigureLogging(
- filename=self._log_file, format_string=format_string,
- log_level=logging_level)
-
self._destination_path = self.ParseStringOption(
options, 'path', default_value='export')
« no previous file with comments | « no previous file | plaso/cli/log2timeline_tool.py » ('j') | plaso/lib/loggers.py » ('J')

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b