diff --git a/tracebackrepy.py b/tracebackrepy.py index 2035941b..ebeacba2 100755 --- a/tracebackrepy.py +++ b/tracebackrepy.py @@ -23,7 +23,7 @@ import sys # We need the service logger to log internal errors -Brent -# import servicelogger +import servicelogger # Used to determine whether or not we use the service logger to log internal # errors. Defaults to false. -Brent @@ -54,9 +54,6 @@ def initialize(useservlog=False, logdir = '.'): global servicelog global logdirectory - if useservlog: - import servicelogger - servicelog = useservlog logdirectory = logdir @@ -210,9 +207,6 @@ def handle_internalerror(error_string, exitcode): Shouldn't return because harshexit will always be called. """ - if servicelog: - import servicelogger - try: print >> sys.stderr, "Internal Error" handle_exception() @@ -246,7 +240,8 @@ def handle_internalerror(error_string, exitcode): # Again we want to ensure that even if we fail to log, we still exit. try: - servicelogger.multi_process_log(exceptionstring, identifier, logdirectory) + if servicelog: + servicelogger.multi_process_log(exceptionstring, identifier, logdirectory) except Exception, e: # if an exception occurs, log it (unfortunately, to the user's log) print 'Inner abort of servicelogger'