def format_command(<EOL>command_args,  <EOL>command_output,  <EOL>):<EOL>
text = '<STR_LIT>'.format(command_args)<EOL>if not command_output:<EOL><INDENT>text += '<STR_LIT>'<EOL><DEDENT>elif logger.getEffectiveLevel() > logging.DEBUG:<EOL><INDENT>text += '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>if not command_output.endswith('<STR_LIT:\n>'):<EOL><INDENT>command_output += '<STR_LIT:\n>'<EOL><DEDENT>text += (<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>).format(command_output)<EOL><DEDENT>return text<EOL>
Format command information for logging.