def log_output(chan):
if hasattr(chan, "<STR_LIT>"):<EOL><INDENT>str = chan.recv(<NUM_LIT>)<EOL>msgs = []<EOL>while len(str) > <NUM_LIT:0>:<EOL><INDENT>msgs.append(str)<EOL>str = chan.recv(<NUM_LIT>)<EOL><DEDENT>msg = '<STR_LIT>'.join(msgs).strip()<EOL>if len(msg) > <NUM_LIT:0>:<EOL><INDENT>logger.info(msg)<EOL><DEDENT><DEDENT>
logs the output from a remote command
the input should be an open channel in  the case of synchronous better_exec_command
otherwise this will not log anything and simply return to the caller
:param chan:
:return: