diff options
| author | dkg | 2018-09-01 05:14:32 -0700 |
|---|---|---|
| committer | jvoisin | 2018-09-01 05:14:32 -0700 |
| commit | e2634f7a5052f0507b245b30e2f2bc25963f863f (patch) | |
| tree | ec8b62ae6a726751f34e74efbce7afbbc3ccc5ef /libmat2/office.py | |
| parent | aba9b72d2c9defc253f954d30dfeb3ae3e46d2cc (diff) | |
Logging cleanup
Diffstat (limited to 'libmat2/office.py')
| -rw-r--r-- | libmat2/office.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libmat2/office.py b/libmat2/office.py index 62d0395..4881253 100644 --- a/libmat2/office.py +++ b/libmat2/office.py | |||
| @@ -19,8 +19,6 @@ from . import abstract, parser_factory | |||
| 19 | assert Set | 19 | assert Set |
| 20 | assert Pattern | 20 | assert Pattern |
| 21 | 21 | ||
| 22 | logging.basicConfig(level=logging.ERROR) | ||
| 23 | |||
| 24 | def _parse_xml(full_path: str): | 22 | def _parse_xml(full_path: str): |
| 25 | """ This function parse XML, with namespace support. """ | 23 | """ This function parse XML, with namespace support. """ |
| 26 | 24 | ||
| @@ -96,7 +94,8 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser): | |||
| 96 | if self._specific_cleanup(full_path) is False: | 94 | if self._specific_cleanup(full_path) is False: |
| 97 | shutil.rmtree(temp_folder) | 95 | shutil.rmtree(temp_folder) |
| 98 | os.remove(self.output_filename) | 96 | os.remove(self.output_filename) |
| 99 | logging.info("Something went wrong during deep cleaning of %s", item.filename) | 97 | logging.warning("Something went wrong during deep cleaning of %s", |
| 98 | item.filename) | ||
| 100 | return False | 99 | return False |
| 101 | 100 | ||
| 102 | if item.filename in self.files_to_keep: | 101 | if item.filename in self.files_to_keep: |
| @@ -110,7 +109,9 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser): | |||
| 110 | if not tmp_parser: | 109 | if not tmp_parser: |
| 111 | shutil.rmtree(temp_folder) | 110 | shutil.rmtree(temp_folder) |
| 112 | os.remove(self.output_filename) | 111 | os.remove(self.output_filename) |
| 113 | logging.info("%s's format (%s) isn't supported", item.filename, mtype) | 112 | logging.error("in file %s, element %s's format (%s) " + |
| 113 | "isn't supported", | ||
| 114 | self.filename, item.filename, mtype) | ||
| 114 | return False | 115 | return False |
| 115 | tmp_parser.remove_all() | 116 | tmp_parser.remove_all() |
| 116 | os.rename(tmp_parser.output_filename, full_path) | 117 | os.rename(tmp_parser.output_filename, full_path) |
