import logging

logger = logging.getLogger(__name__)

def __virtual__():
    '''
    Only load if jenkins_common module exist.
    '''
    if 'jenkins_common.call_groovy_script' not in __salt__:
        return (
            False,
            'The jenkins_audittrail state module cannot be loaded: '
            'jenkins_common not found')
    return True

def config (name, type="console", log="", limit=0, count=0, output="STD_OUT",
            date_format="yyyy-MM-dd HH:mm:ss:SSS", log_prefix="", syslog_server_hostname="",
            syslog_server_port=514, syslog_facility="SYSLOG",
            app_name="jenkins", message_hostname="", message_format="RFC_3164"):
    """
    Jenkins AuditTrail logging config state method

    :param type: logger type. one of: console (default), file, syslog
    Console Logger params:
    :param output: STD_OUT or STD_ERR
    :param date_format
    :param log_prefix
    File Logger params:
    :param log: path to log file
    :param limit: log file size
    :param count: log file count to keep
    Syslog Logger params:
    :param syslog_server_hostname
    :param syslog_server_port
    :param syslog_facility
    :param app_name
    :param message_hostname
    :param message_format: RFC_3164 or RFC_5424

    :returns: salt-specified state dict
    """

    template = __salt__['jenkins_common.load_template'](
        'salt://jenkins/files/groovy/audittrail_config.template',
        __env__)
    return __salt__['jenkins_common.api_call'](name, template,
                        ["CREATED", "EXISTS"],
                        {
                            'logger_type': type,
                            'output': output,
                            'date_format': date_format,
                            'log_prefix': log_prefix if log_prefix else "",
                            'log': log if log else "",
                            'limit': limit,
                            'count': count,
                            'syslog_server_hostname': syslog_server_hostname if syslog_server_hostname else "",
                            'syslog_server_port': syslog_server_port,
                            'syslog_facility': syslog_facility,
                            'app_name': app_name,
                            'message_hostname': message_hostname if message_hostname else "",
                            'message_format': message_format if message_format else "",
                        },
                        'AuditTrail logger configuration')

def params (name, pattern="", log_build_cause=True):
    """
    Jenkins AuditTrail logging params state method

    :param pattern
    :param log_build_cause

    :returns: salt-specified state dict
    """

    template = __salt__['jenkins_common.load_template'](
        'salt://jenkins/files/groovy/audittrail_params.template',
        __env__)
    return __salt__['jenkins_common.api_call'](name, template,
                                               ["CHANGED", "EXISTS"],
                                               {
                                                   'pattern': pattern if pattern else "",
                                                   'log_build_cause': str(log_build_cause).lower(),
                                               },
                                               'AuditTrail logger params')
