Left: | ||
Right: |
OLD | NEW |
---|---|
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 """The log2timeline CLI tool.""" | 2 """The log2timeline CLI tool.""" |
3 | 3 |
4 from __future__ import unicode_literals | 4 from __future__ import unicode_literals |
5 | 5 |
6 import argparse | 6 import argparse |
7 import logging | 7 import logging |
8 import sys | 8 import sys |
9 import time | 9 import time |
10 import textwrap | 10 import textwrap |
11 | 11 |
12 from dfvfs.lib import definitions as dfvfs_definitions | 12 from dfvfs.lib import definitions as dfvfs_definitions |
13 | 13 |
14 import plaso | 14 import plaso |
15 | 15 |
16 # The following import makes sure the output modules are registered. | 16 # The following import makes sure the output modules are registered. |
17 from plaso import output # pylint: disable=unused-import | 17 from plaso import output # pylint: disable=unused-import |
18 | 18 |
19 from plaso.analyzers.hashers import manager as hashers_manager | 19 from plaso.analyzers.hashers import manager as hashers_manager |
20 from plaso.cli import extraction_tool | 20 from plaso.cli import extraction_tool |
21 from plaso.cli import logging_filter | |
Joachim Metz
2018/03/22 06:06:46
why these changes? are they as part of the biplist
onager
2018/03/25 08:32:31
They could be done separately, but they only suppo
| |
22 from plaso.cli import status_view | 21 from plaso.cli import status_view |
23 from plaso.cli import tools | 22 from plaso.cli import tools |
24 from plaso.cli import views | 23 from plaso.cli import views |
25 from plaso.cli.helpers import manager as helpers_manager | 24 from plaso.cli.helpers import manager as helpers_manager |
26 from plaso.engine import engine | 25 from plaso.engine import engine |
27 from plaso.engine import filter_file | 26 from plaso.engine import filter_file |
28 from plaso.engine import single_process as single_process_engine | 27 from plaso.engine import single_process as single_process_engine |
29 from plaso.lib import definitions | 28 from plaso.lib import definitions |
30 from plaso.lib import errors | 29 from plaso.lib import errors |
31 from plaso.lib import loggers | 30 from plaso.lib import loggers |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
310 self._output_writer.Write('\n') | 309 self._output_writer.Write('\n') |
311 self._output_writer.Write(argument_parser.format_usage()) | 310 self._output_writer.Write(argument_parser.format_usage()) |
312 return False | 311 return False |
313 | 312 |
314 self._command_line_arguments = self.GetCommandLineArguments() | 313 self._command_line_arguments = self.GetCommandLineArguments() |
315 | 314 |
316 loggers.ConfigureLogging( | 315 loggers.ConfigureLogging( |
317 debug_output=self._debug_mode, filename=self._log_file, | 316 debug_output=self._debug_mode, filename=self._log_file, |
318 quiet_mode=self._quiet_mode) | 317 quiet_mode=self._quiet_mode) |
319 | 318 |
320 if self._debug_mode: | |
321 log_filter = logging_filter.LoggingFilter() | |
322 root_logger = logging.getLogger() | |
323 root_logger.addFilter(log_filter) | |
324 | |
325 return True | 319 return True |
326 | 320 |
327 def ParseOptions(self, options): | 321 def ParseOptions(self, options): |
328 """Parses the options. | 322 """Parses the options. |
329 | 323 |
330 Args: | 324 Args: |
331 options (argparse.Namespace): command line arguments. | 325 options (argparse.Namespace): command line arguments. |
332 | 326 |
333 Raises: | 327 Raises: |
334 BadConfigOption: if the options are invalid. | 328 BadConfigOption: if the options are invalid. |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
494 '{0:=^80s}\n'.format(' log2timeline/plaso information ')) | 488 '{0:=^80s}\n'.format(' log2timeline/plaso information ')) |
495 | 489 |
496 plugin_list = self._GetPluginData() | 490 plugin_list = self._GetPluginData() |
497 for header, data in plugin_list.items(): | 491 for header, data in plugin_list.items(): |
498 table_view = views.ViewsFactory.GetTableView( | 492 table_view = views.ViewsFactory.GetTableView( |
499 self._views_format_type, column_names=['Name', 'Description'], | 493 self._views_format_type, column_names=['Name', 'Description'], |
500 title=header) | 494 title=header) |
501 for entry_header, entry_data in sorted(data): | 495 for entry_header, entry_data in sorted(data): |
502 table_view.AddRow([entry_header, entry_data]) | 496 table_view.AddRow([entry_header, entry_data]) |
503 table_view.Write(self._output_writer) | 497 table_view.Write(self._output_writer) |
OLD | NEW |