diff options
author | astokes <astokes@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2010-04-22 14:49:44 +0000 |
---|---|---|
committer | astokes <astokes@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2010-04-22 14:49:44 +0000 |
commit | 0005940c1ef4275c5fdb4e6e40d4d378fd52ff6c (patch) | |
tree | 327990addfd2a5dedfff0d1e02db087d4e71e726 /sos | |
parent | 90d2ef6fa91d6e5f634864645efcb7c89f0c7437 (diff) | |
download | sos-0005940c1ef4275c5fdb4e6e40d4d378fd52ff6c.tar.gz |
updated man page to describe debug option and added new switch
during plugin exception attempt to print to stdout the issue and also to a log file
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@932 ef72aa8b-4018-0410-8976-d6e080ef94d8
Diffstat (limited to 'sos')
-rwxr-xr-x | sos/sosreport.py | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py index a11c5160..6b236e3b 100755 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -84,7 +84,7 @@ def doException(etype, eval, etrace): if hasattr(sys, 'ps1') or not sys.stderr.isatty(): # we are in interactive mode or we don't have a tty-like # device, so we call the default hook - sys.__excepthook__(etype, value, traceback) + sys.__excepthook__(etype, eval, etrace) else: import traceback, pdb # we are NOT in interactive mode, print the exception... @@ -173,7 +173,7 @@ def parse_options(opts): help="increase verbosity") __cmdParser__.add_option("--debug", action="count", \ dest="debug", \ - help="enabling debugging") + help="enabling debugging through python debugger") __cmdParser__.add_option("--ticket-number", action="store", \ dest="ticketNumber", \ help="set ticket number") @@ -186,6 +186,9 @@ def parse_options(opts): __cmdParser__.add_option("--tmp-dir", action="store", \ dest="tmp_dir", \ help="specify alternate temporary directory", default="/tmp") + __cmdParser__.add_option("--dst-dir", action="store", \ + dest="dst_dir", \ + help="specify alternate directory to store compressed report", default="/tmp") __cmdParser__.add_option("--diagnose", action="store_true", \ dest="diagnose", \ help="enable diagnostics", default=False) @@ -194,7 +197,7 @@ def parse_options(opts): help="enable analyzations", default=False) __cmdParser__.add_option("--report", action="store_true", \ dest="report", \ - help="disable html/xml reporting", default=False) + help="Enable html/xml reporting", default=False) __cmdParser__.add_option("--profile", action="store_true", \ dest="profiler", \ help="turn on profiling", default=False) @@ -365,7 +368,7 @@ def sosreport(opts): if GlobalVars.__cmdLineOpts__.profiler: proflog = logging.getLogger('sosprofile') proflog.setLevel(logging.DEBUG) - + # if stdin is not a tty, disable colors and don't ask questions if not sys.stdin.isatty(): GlobalVars.__cmdLineOpts__.nocolors = True @@ -690,6 +693,11 @@ No changes will be made to your system. except: if GlobalVars.__raisePlugins__: raise + else: + error_log = open(logdir + "/sosreport-plugin-errors.txt", "a") + traceback.print_exception(etype, eval, etrace, limit=2, file=sys.stdout) + error_log.write(traceback.format_exc) + error_log.close() print _(" Running plugins. Please wait ...") print @@ -707,6 +715,12 @@ No changes will be made to your system. except: if GlobalVars.__raisePlugins__: raise + else: + error_log = open(logdir + "/sosreport-plugin-errors.txt", "a") + traceback.print_exception(etype, eval, etrace, limit=2, file=sys.stdout) + error_log.write(traceback.format_exc) + error_log.close() + print if GlobalVars.__cmdLineOpts__.report: |