def log(message, log_level=0, current_log_level=None):
    """
    Auxiliary function to use as log level

    :param current_log_level: Log level selected at the moment of running the program
    :type current_log_level: int

    :param message: Message to display
    :type message: basestring

    :param log_level: log level: 0-4
    :type log_level: int
    """
    from sys import stdout
    from os import environ
    if current_log_level is None:
        try:
            _current_log_level = int(environ['PLECOST_LOG_LEVEL'])
        except KeyError:
            _current_log_level = 0
    else:
        _current_log_level = current_log_level
    if log_level <= _current_log_level:
        print(message, end='')
        stdout.flush()
