From 470a7642ee2e338b32eed369d1a0f8b924af6e2e Mon Sep 17 00:00:00 2001 From: Jesse Jaggars Date: Thu, 8 Mar 2012 17:30:05 -0600 Subject: write a debug message to the log when a non-existent file is encountered by sos.utilities.grep --- sos/utilities.py | 3 +++ 1 file changed, 3 insertions(+) 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) -- cgit