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

Unified Diff: plaso/cli/tools.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
Index: plaso/cli/tools.py
diff --git a/plaso/cli/tools.py b/plaso/cli/tools.py
index 04b61543149facbec38dbb20b34bac8f12c9e5b7..ca55998c3a1e57efd43994cd265550cc4418c01f 100644
--- a/plaso/cli/tools.py
+++ b/plaso/cli/tools.py
@@ -67,38 +67,6 @@ class CLITool(object):
self.list_timezones = False
self.preferred_encoding = preferred_encoding
- def _ConfigureLogging(
- self, filename=None, format_string=None, log_level=None):
- """Configure the logger.
-
- If a filename is specified and the corresponding log file already exists,
- the file is truncated.
-
- Args:
- filename (Optional[str]): path to a filename to append logs to, where
- None means logs will not be redirected to a file.
- format_string (Optional[str]): format string for the logs, where None
- configures the logger to use a default format string.
- log_level (Optional[int]): integer representing the log level, for
- example logging.DEBUG, where None represents logging.INFO.
- """
- # Remove all possible log handlers.
- for handler in logging.root.handlers:
- logging.root.removeHandler(handler)
-
- if log_level is None:
- log_level = logging.INFO
-
- if not format_string:
- format_string = '[%(levelname)s] %(message)s'
-
- if filename:
- logging.basicConfig(
- level=log_level, format=format_string, filename=filename,
- filemode='w')
- else:
- logging.basicConfig(level=log_level, format=format_string)
-
def _EncodeString(self, string):
"""Encodes a string in the preferred encoding.
« no previous file with comments | « plaso/cli/psteal_tool.py ('k') | plaso/engine/configurations.py » ('j') | plaso/lib/loggers.py » ('J')

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