Commit 1e02414741f00bb0a72349f54836c4940af805e4
1 parent
bf80b6c3
just realized that log.exception = log.error(..., exc_info=True)
--> fixed 2 logs from outside of error handlers and
2 instances were trace is only wanted at debug level
Showing
1 changed file
with
4 additions
and
4 deletions
oletools/olevba.py
| @@ -2701,7 +2701,7 @@ class VBA_Parser_CLI(VBA_Parser): | @@ -2701,7 +2701,7 @@ class VBA_Parser_CLI(VBA_Parser): | ||
| 2701 | print 'No VBA macros found.' | 2701 | print 'No VBA macros found.' |
| 2702 | except Exception as exc: | 2702 | except Exception as exc: |
| 2703 | # display the exception with full stack trace for debugging | 2703 | # display the exception with full stack trace for debugging |
| 2704 | - log.exception('Error processing file %s (%s)' % (self.filename, exc)) | 2704 | + log.error('Error processing file %s (%s)' % (self.filename, exc)) |
| 2705 | log.debug('Traceback:', exc_info=True) | 2705 | log.debug('Traceback:', exc_info=True) |
| 2706 | raise ProcessingError(self.filename, exc) | 2706 | raise ProcessingError(self.filename, exc) |
| 2707 | print '' | 2707 | print '' |
| @@ -2767,7 +2767,7 @@ class VBA_Parser_CLI(VBA_Parser): | @@ -2767,7 +2767,7 @@ class VBA_Parser_CLI(VBA_Parser): | ||
| 2767 | result['json_conversion_successful'] = True | 2767 | result['json_conversion_successful'] = True |
| 2768 | except Exception as exc: | 2768 | except Exception as exc: |
| 2769 | # display the exception with full stack trace for debugging | 2769 | # display the exception with full stack trace for debugging |
| 2770 | - log.exception('Error processing file %s (%s)' % (self.filename, exc)) | 2770 | + log.error('Error processing file %s (%s)' % (self.filename, exc)) |
| 2771 | log.debug('Traceback:', exc_info=True) | 2771 | log.debug('Traceback:', exc_info=True) |
| 2772 | raise ProcessingError(self.filename, exc) | 2772 | raise ProcessingError(self.filename, exc) |
| 2773 | 2773 | ||
| @@ -2941,14 +2941,14 @@ def main(): | @@ -2941,14 +2941,14 @@ def main(): | ||
| 2941 | if options.output_mode in ('triage', 'unspecified'): | 2941 | if options.output_mode in ('triage', 'unspecified'): |
| 2942 | print '%-12s %s - File not found' % ('?', filename) | 2942 | print '%-12s %s - File not found' % ('?', filename) |
| 2943 | else: | 2943 | else: |
| 2944 | - log.exception('Given path %r does not exist!' % filename) | 2944 | + log.error('Given path %r does not exist!' % filename) |
| 2945 | return_code = RETURN_FILE_NOT_FOUND if return_code == 0 \ | 2945 | return_code = RETURN_FILE_NOT_FOUND if return_code == 0 \ |
| 2946 | else RETURN_SEVERAL_ERRS | 2946 | else RETURN_SEVERAL_ERRS |
| 2947 | else: | 2947 | else: |
| 2948 | if options.output_mode in ('triage', 'unspecified'): | 2948 | if options.output_mode in ('triage', 'unspecified'): |
| 2949 | print '%-12s %s - Failed to read from zip file %s' % ('?', filename, container) | 2949 | print '%-12s %s - Failed to read from zip file %s' % ('?', filename, container) |
| 2950 | else: | 2950 | else: |
| 2951 | - log.exception('Exception opening/reading %r from zip file %r: %s' | 2951 | + log.error('Exception opening/reading %r from zip file %r: %s' |
| 2952 | % (filename, container, data)) | 2952 | % (filename, container, data)) |
| 2953 | return_code = RETURN_XGLOB_ERR if return_code == 0 \ | 2953 | return_code = RETURN_XGLOB_ERR if return_code == 0 \ |
| 2954 | else RETURN_SEVERAL_ERRS | 2954 | else RETURN_SEVERAL_ERRS |