<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write(*args, **kwargs):
 """Redirectable wrapper for print statements."""

    debug = kwargs.pop("debug", None)
    warning = kwargs.pop("warning", None)
    if _logger:
        kwargs.pop("end", None)
        kwargs.pop("file", None)
        if debug:
            _logger.debug(*args, **kwargs)
        elif warning:
            _logger.warning(*args, **kwargs)
        else:
            _logger.info(*args, **kwargs)
    else:
        print(*args, **kwargs)