Move most warning/info statements to stderr

This commit is contained in:
Steven Robertson 2017-05-15 11:58:12 -07:00
parent 9bcfc36b7a
commit 29c595ddc5
3 changed files with 11 additions and 10 deletions

View File

@ -1,5 +1,6 @@
import io
import os
import sys
import tempfile
from cStringIO import StringIO
from subprocess import Popen, PIPE
@ -273,8 +274,8 @@ class X264Output(Output, ClsMod):
try:
subp.stdin.write(buffer(buf))
except IOError, e:
print 'Exception while writing. Log:'
print subp.stderr.read()
print >> sys.stderr, 'Exception while writing. Log:'
print >> sys.stderr, subp.stderr.read()
raise e
def encode(self, buf):
@ -388,8 +389,8 @@ class VPxOutput(Output, ClsMod):
try:
subp.stdin.write(buffer(buf))
except IOError, e:
print 'Exception while writing. Log:'
print subp.stderr.read()
print >> sys.stderr, 'Exception while writing. Log:'
print >> sys.stderr, subp.stderr.read()
raise e
def encode(self, buf):

View File

@ -352,7 +352,7 @@ class RenderManager(ClsMod):
# Do a blocking sync to free up resources. This may slightly reduce
# parallelism but makes it a whole heck of a lot easier to keep
# using the computer while things render.
print 'Launches became blocking, synchronizing'
print >> sys.stderr, 'Launches became blocking, synchronizing'
iter_stream_right.synchronize()
# Make sure the other stream is done flushing before we start

10
main.py
View File

@ -74,8 +74,8 @@ def main(args, prof):
if getattr(file_like, 'close', None):
file_like.close()
for key, val in log:
print '\n=== %s ===' % key
print val
print >> sys.stderr, '\n=== %s ===' % key
print >> sys.stderr, val
evt = buf = next_evt = next_buf = None
for idx, t in enumerate(list(times) + [None]):
@ -98,12 +98,12 @@ def main(args, prof):
os.rename(args.rawfn + '.tmp', args.rawfn)
except:
import traceback
print 'Failed to write %s: %s' % (
print >> sys.stderr, 'Failed to write %s: %s' % (
args.rawfn, traceback.format_exc())
print '%s%s (%3d/%3d), %dms' % (
print >> sys.stderr, '%s%s (%3d/%3d), %dms' % (
('%d: ' % args.device) if args.device >= 0 else '',
name, idx, len(times), last_render_time_ms)
sys.stdout.flush()
sys.stderr.flush()
save(None)