Use logging instead of sys.stderr.write()

@jaredmiwilliams @also