Go back to stderr rather than warnings module

Also add extra debug information

Change-Id: I3e4dfe15dbdac6e3e681c1e0766447c2106db238
This commit is contained in:
Joshua Hesketh 2014-07-16 19:29:06 +10:00
parent adc8fc6866
commit 14aad35b65
1 changed files with 6 additions and 4 deletions

View File

@ -18,8 +18,8 @@
import fileinput
import os.path
import re
import sys
import types
import warnings
import wsgiref.util
import zlib
@ -86,7 +86,8 @@ def safe_path(root, log_name):
def get_swift_line_generator(logname, config):
if not config.has_section('swift'):
warnings.warn('Not configured to use swift..')
sys.stderr.write('Not configured to use swift..\n')
sys.stderr.write('logname: %s\n' % logname)
return None
try:
@ -149,8 +150,9 @@ def get_swift_line_generator(logname, config):
except Exception:
import traceback
warnings.warn("Error fetching from swift")
warnings.warn(traceback.format_exc())
sys.stderr.write("Error fetching from swift.\n")
sys.stderr.write('logname: %s\n' % logname)
traceback.print_exc()
return None