<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def console_output(msg, logging_msg=None):
 """Use instead of print, to clear the status information before printing"""

    assert isinstance(msg, bytes)
    assert isinstance(logging_msg, bytes) or logging_msg is None

    from polysh import remote_dispatcher

    remote_dispatcher.log(logging_msg or msg)
    if remote_dispatcher.options.interactive:
        from polysh.stdin import the_stdin_thread
        the_stdin_thread.no_raw_input()
        global last_status_length
        if last_status_length:
            safe_write('\r{}\r'.format(
                last_status_length * ' ').encode())
            last_status_length = 0
    safe_write(msg)