Redirect some print statments to stderr
Otherwise they errors will not show up if the console output is redirected to a file
This commit is contained in:
parent
c5d2f8bdab
commit
c0178db779
|
@ -151,7 +151,7 @@ def ngettext(s_sing, s_plural, n, replace_sing=None, replace_plural=None):
|
|||
try:
|
||||
locale.setlocale(locale.LC_ALL, '')
|
||||
except locale.Error as error:
|
||||
print(error)
|
||||
print(error, file=sys.stderr)
|
||||
|
||||
try:
|
||||
LANG = get_default_lang()
|
||||
|
@ -161,7 +161,7 @@ try:
|
|||
os.environ['LANG'] = LANG
|
||||
print('Found default language: %s' % LANG)
|
||||
except Exception as error:
|
||||
print('Failed to determine default language')
|
||||
print('Failed to determine default language', file=sys.stderr)
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
|
@ -177,6 +177,6 @@ for dir_ in iter_locale_dirs():
|
|||
else:
|
||||
break
|
||||
else:
|
||||
print('No translations found')
|
||||
print('Dirs searched: %s' % get_locale_dirs())
|
||||
print('No translations found', file=sys.stderr)
|
||||
print('Dirs searched: %s' % get_locale_dirs(), file=sys.stderr)
|
||||
_ = _translation.gettext
|
||||
|
|
|
@ -28,7 +28,7 @@ def parseLogLevel(arg):
|
|||
return int(arg)
|
||||
if arg.isupper() and hasattr(logging, arg):
|
||||
return getattr(logging, arg)
|
||||
print(_('%s is not a valid loglevel') % repr(arg))
|
||||
print(_('%s is not a valid loglevel') % repr(arg), file=sys.stderr)
|
||||
return 0
|
||||
|
||||
def parseLogTarget(arg):
|
||||
|
@ -69,7 +69,8 @@ def parseAndSetLogLevels(arg):
|
|||
target = parseLogTarget(target.strip())
|
||||
if target:
|
||||
logging.getLogger(target).setLevel(level)
|
||||
print("Logger %s level set to %d" % (target, level))
|
||||
print("Logger %s level set to %d" % (target, level),
|
||||
file=sys.stderr)
|
||||
|
||||
|
||||
class colors:
|
||||
|
|
|
@ -85,7 +85,7 @@ class ExceptionDialog():
|
|||
traceback.print_exception(type_, value, tb, None, trace)
|
||||
self.text = self.get_issue_text(trace.getvalue())
|
||||
buffer_.set_text(self.text)
|
||||
print(self.text)
|
||||
print(self.text, file=sys.stderr)
|
||||
self.exception_view.set_editable(False)
|
||||
self.dialog.show()
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Reference in New Issue