'Create log entry
:param msg: to log
:param level: of log, e.g. DEBUG, INFO, etc.
:param args: to pass to logger
:param kwargs: to pass to logger'

def log(self, msg, level=INFO, *args, **kwargs):

    cur_thread = threading.currentThread().getName()
    cur_hash = u''
    if ((level == ERROR) and sickbeard.CUR_COMMIT_HASH and (len(sickbeard.CUR_COMMIT_HASH) > 6)):
        cur_hash = u'[{0}]    '.format(sickbeard.CUR_COMMIT_HASH[:7])
    message = u'{thread}    ::    {hash}{message}'.format(thread=cur_thread, hash=cur_hash, message=msg)
    ssl_errors = [u'error    \\[Errno    \\d+\\]    _ssl.c:\\d+:    error:\\d+\\s*:SSL    routines:SSL23_GET_SERVER_HELLO:tlsv1    alert    internal    error', u'error    \\[SSL:    SSLV3_ALERT_HANDSHAKE_FAILURE\\]    sslv3    alert    handshake    failure    \\(_ssl\\.c:\\d+\\)']
    for ssl_error in ssl_errors:
        check = re.sub(ssl_error, u'See:    http://git.io/vuU5V', message)
        if (check != message):
            message = check
            level = WARNING
    if (level == ERROR):
        classes.ErrorViewer.add(classes.UIError(message))
    elif (level == WARNING):
        classes.WarningViewer.add(classes.UIError(message))
    try:
        if (level == ERROR):
            self.logger.exception(message, *args, **kwargs)
        else:
            self.logger.log(level, message, *args, **kwargs)
    except Exception:
        if (msg and msg.strip()):
            print(msg.strip())
