func (hook *FluentHook) Tag() string {
	if hook.tag == nil {
		return ""
	}
	return *hook.tag
}
Tag returns custom static tag.
package logrus_fluent
import (
	"github.com/fluent/fluent-logger-golang/fluent"
	"github.com/sirupsen/logrus"
)
const (
	TagName = "fluent"
	TagField = "tag"
	MessageField = "message"
)
var defaultLevels = []logrus.Level{
	logrus.PanicLevel,
	logrus.FatalLevel,
	logrus.ErrorLevel,
	logrus.WarnLevel,
	logrus.InfoLevel,
}
type FluentHook struct {
	Fluent *fluent.Fluent
	conf   Config
	levels []logrus.Level
	tag    *string
	messageField string
	ignoreFields map[string]struct{}
	filters      map[string]func(interface{}) interface{}
	customizers  []func(entry *logrus.Entry, data logrus.Fields)
}
func New(host string, port int) (*FluentHook, error) {
	return NewWithConfig(Config{
		Host:                host,
		Port:                port,
		DefaultMessageField: MessageField,
	})
}
func NewWithConfig(conf Config) (*FluentHook, error) {
	var fd *fluent.Fluent
	if !conf.DisableConnectionPool {
		var err error
		fd, err = fluent.New(conf.FluentConfig())
		if err != nil {
			return nil, err
		}
	}
	hook := &FluentHook{
		Fluent:       fd,
		conf:         conf,
		levels:       conf.LogLevels,
		ignoreFields: make(map[string]struct{}),
		filters:      make(map[string]func(interface{}) interface{}),
	}
	if len(hook.levels) == 0 {
		hook.levels = defaultLevels
	}
	if conf.DefaultTag != "" {
		tag := conf.DefaultTag
		hook.tag = &tag
	}
	if conf.DefaultMessageField != "" {
		hook.messageField = conf.DefaultMessageField
	}
	for k, v := range conf.DefaultIgnoreFields {
		hook.ignoreFields[k] = v
	}
	for k, v := range conf.DefaultFilters {
		hook.filters[k] = v
	}
	return hook, nil
}
func NewHook(host string, port int) *FluentHook {
	hook, _ := NewWithConfig(Config{
		Host:                  host,
		Port:                  port,
		DefaultMessageField:   MessageField,
		DisableConnectionPool: true,
	})
	return hook
}
func (hook *FluentHook) Levels() []logrus.Level {
	return hook.levels
}
func (hook *FluentHook) SetLevels(levels []logrus.Level) {
	hook.levels = levels
}