diff options
| author | Foram Katharotiya (OpenERP) <fka@tinyerp.com> | 2012-06-22 12:18:39 +0530 |
|---|---|---|
| committer | Foram Katharotiya (OpenERP) <fka@tinyerp.com> | 2012-06-22 12:18:39 +0530 |
| commit | 0c374a66bc3de5cdf48eb66b2078c0946aa045db (patch) | |
| tree | 50320ad4188001b50cb8b0dcd239cc121ad7ef48 /addons/document/std_index.py | |
| parent | e02d8a68ef8eba0ab3b6c084301e0b707e8402e6 (diff) | |
[IMP] Add logging at the top of python files
bzr revid: fka@tinyerp.com-20120622064839-llitm8szgikxznwr
Diffstat (limited to 'addons/document/std_index.py')
| -rw-r--r-- | addons/document/std_index.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/document/std_index.py b/addons/document/std_index.py index e153d018bf0..49ac9a5c906 100644 --- a/addons/document/std_index.py +++ b/addons/document/std_index.py @@ -25,6 +25,7 @@ import StringIO import odt2txt import sys, zipfile, xml.dom.minidom import logging +_logger = logging.getLogger(__name__) def _to_unicode(s): try: @@ -101,9 +102,9 @@ class DocIndex(indexer): (data, _) = pop.communicate() return _to_unicode(data) except OSError: - logger = logging.getLogger('document.DocIndex') - logger.warn("Failed attempt to execute antiword (MS Word reader). Antiword is necessary to index the file %s of MIME type %s. Detailed error available at DEBUG level.", fname, self._getMimeTypes()[0]) - logger.debug("Trace of the failed file indexing attempt: ", exc_info=True) + + _logger.warn("Failed attempt to execute antiword (MS Word reader). Antiword is necessary to index the file %s of MIME type %s. Detailed error available at DEBUG level.", fname, self._getMimeTypes()[0]) + _logger.debug("Trace of the failed file indexing attempt: ", exc_info=True) return False cntIndex.register(DocIndex()) |
