Help us shape the future of Go! Take the 2026 Go Developer Survey

fluent

package module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(cfg *conf.Logger) (bLogger.Logger, error)

NewLogger 创建一个新的日志记录器 - Fluent

Types

type Logger added in v0.1.0

type Logger struct {
	// contains filtered or unexported fields
}

Logger is fluent logger sdk.

func NewFluentLogger added in v0.1.0

func NewFluentLogger(addr string, opts ...Option) (*Logger, error)

NewFluentLogger new a std logger with options. target:

tcp://127.0.0.1:24224
unix://var/run/fluent/fluent.sock

func (*Logger) Close added in v0.1.0

func (l *Logger) Close() error

Close the logger.

func (*Logger) Debug added in v0.1.3

func (l *Logger) Debug(_ context.Context, msg string, keyvals ...any)

Debug 输出 DEBUG 级别日志。

func (*Logger) Error added in v0.1.3

func (l *Logger) Error(_ context.Context, msg string, keyvals ...any)

Error 输出 ERROR 级别日志。

func (*Logger) Info added in v0.1.3

func (l *Logger) Info(_ context.Context, msg string, keyvals ...any)

Info 输出 INFO 级别日志。

func (*Logger) Warn added in v0.1.3

func (l *Logger) Warn(_ context.Context, msg string, keyvals ...any)

Warn 输出 WARN 级别日志。

func (*Logger) With added in v0.1.3

func (l *Logger) With(keyvals ...any) bLogger.Logger

With 返回附加了指定 key-value 对的新 Logger 实例。

type Option added in v0.1.0

type Option func(*options)

Option is fluentd logger option.

func WithAsync added in v0.1.0

func WithAsync(async bool) Option

WithAsync with config Async.

func WithBufferLimit added in v0.1.0

func WithBufferLimit(bufferLimit int) Option

WithBufferLimit with config BufferLimit.

func WithForceStopAsyncSend added in v0.1.0

func WithForceStopAsyncSend(forceStopAsyncSend bool) Option

WithForceStopAsyncSend with config ForceStopAsyncSend.

func WithMaxRetry added in v0.1.0

func WithMaxRetry(maxRetry int) Option

WithMaxRetry with config MaxRetry.

func WithMaxRetryWait added in v0.1.0

func WithMaxRetryWait(maxRetryWait int) Option

WithMaxRetryWait with config MaxRetryWait.

func WithRetryWait added in v0.1.0

func WithRetryWait(retryWait int) Option

WithRetryWait with config RetryWait.

func WithTagPrefix added in v0.1.0

func WithTagPrefix(tagPrefix string) Option

WithTagPrefix with config TagPrefix.

func WithTimeout added in v0.1.0

func WithTimeout(timeout time.Duration) Option

WithTimeout with config Timeout.

func WithWriteTimeout added in v0.1.0

func WithWriteTimeout(writeTimeout time.Duration) Option

WithWriteTimeout with config WriteTimeout.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL