diff options
author | Jesse Jaggars <jjaggars@redhat.com> | 2012-03-08 17:30:05 -0600 |
---|---|---|
committer | Jesse Jaggars <jjaggars@redhat.com> | 2012-03-08 17:30:05 -0600 |
commit | 470a7642ee2e338b32eed369d1a0f8b924af6e2e (patch) | |
tree | 1a145b848a9f1f9af6eac6dc1e6307919ee8c32e | |
parent | a36701a1923f49fd6dbb20931c6b7cac85e5f659 (diff) | |
download | sos-470a7642ee2e338b32eed369d1a0f8b924af6e2e.tar.gz |
write a debug message to the log when a non-existent file is encountered by sos.utilities.grep
-rw-r--r-- | sos/utilities.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sos/utilities.py b/sos/utilities.py index e0d57dfe..687c2513 100644 --- a/sos/utilities.py +++ b/sos/utilities.py @@ -33,6 +33,7 @@ import logging import zipfile import tarfile import hashlib +import logging from contextlib import closing try: from cStringIO import StringIO @@ -45,6 +46,8 @@ def fileobj(path_or_file, mode='r'): try: return open(path_or_file, mode) except: + log = logging.getLogger('sos') + log.debug("fileobj: %s could not be opened" % path_or_file) return closing(StringIO()) else: return closing(path_or_file) |