def __init__(self, tags=None, hostname=None, fqdn=False, message_type='JSON', indent=None):
        """
        :param tags: a list of tags to add to every messages
        :hostname: force a specific hostname
        :fqdn: a boolean to use the FQDN instead of the machine's hostname
        :message_type: the message type for Logstash formatters
        :indent: indent level of the JSON output
        """
        self.message_type = message_type
        self.tags = tags if tags is not None else []
        self.extra_tags = []
        self.indent = indent

        if hostname:
            self.host = hostname
        elif fqdn:
            self.host = socket.getfqdn()
        else:
            self.host = socket.gethostname()
def __init__ ( self , tags = None , hostname = None , fqdn = False , message_type = 'JSON' , indent = None ) : self . message_type = message_type self . tags = tags if tags is not None else [ ] self . extra_tags = [ ] self . indent = indent if hostname : self . host = hostname elif fqdn : self . host = socket . getfqdn ( ) else : self . host = socket . gethostname ( )
:param tags: a list of tags to add to every messages
        :hostname: force a specific hostname
        :fqdn: a boolean to use the FQDN instead of the machine's hostname
        :message_type: the message type for Logstash formatters
        :indent: indent level of the JSON output