Skip to content

Commit

Permalink
Changes for pinfo log file option and print user warning to stderr lo…
Browse files Browse the repository at this point in the history
  • Loading branch information
jkppr authored Jan 27, 2024
1 parent 81e3c36 commit 7c98809
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions plaso/cli/pinfo_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1523,6 +1523,7 @@ def ParseArguments(self, arguments):

self.AddBasicOptions(argument_parser)
self.AddStorageOptions(argument_parser)
self.AddLogFileOptions(argument_parser)

if self._CanEnforceProcessMemoryLimit():
helpers_manager.ArgumentHelperManager.AddCommandLineArguments(
Expand Down Expand Up @@ -1608,6 +1609,8 @@ def ParseOptions(self, options):
"""
self._ParseInformationalOptions(options)

self._ParseLogFileOptions(options)

self._verbose = getattr(options, 'verbose', False)

self._report_type = getattr(
Expand Down
8 changes: 5 additions & 3 deletions plaso/cli/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ def _PrintUserWarning(self, warning_text):
warning_text (str): text used to warn the user.
"""
warning_text = textwrap.wrap(f'WARNING: {warning_text:s}', 80)
print('\n'.join(warning_text))
print('')
print('\n'.join(warning_text), file=sys.stderr)
print('', file=sys.stderr)

self._has_user_warning = True

Expand Down Expand Up @@ -281,7 +281,9 @@ def CheckOutDated(self):
date_time_delta = datetime.datetime.utcnow() - version_date_time

if date_time_delta.days > 180:
logger.warning('This version of plaso is more than 6 months old.')
logger.warning((
'This version of plaso is more than 6 months old. We strongly '
'recommend to update it.'))

self._PrintUserWarning((
'the version of plaso you are using is more than 6 months old. We '
Expand Down

0 comments on commit 7c98809

Please sign in to comment.