@asyncio.coroutine<EOL><INDENT>def stream(self, report):<DEDENT>
with self.ClientSession() as session:<EOL><INDENT>lines = []<EOL>for job in report['<STR_LIT>']:<EOL><INDENT>key = '<STR_LIT>' % (self.name, job)<EOL>for minute in report['<STR_LIT>'][job]:<EOL><INDENT>for k, v in report['<STR_LIT>'][job][minute].items():<EOL><INDENT>lines.append('<STR_LIT>' % (key, k))<EOL>lines.append('<STR_LIT>' % (key, k, v))<EOL><DEDENT><DEDENT><DEDENT>lines.append("<STR_LIT>")<EOL>data = "<STR_LIT:\n>".join(lines)<EOL>logger.info(data)<EOL>yield from session.post(self.url, data=bytes(data.encode('<STR_LIT:utf-8>')))<EOL><DEDENT>
Stream reports to application logs