Documentation
¶
Index ¶
- Constants
- func AddHook(hook logrus.Hook)
- func Debug(ctx context.Context, args ...any)
- func Debugf(ctx context.Context, format string, args ...any)
- func EnsureTraceID(ctx context.Context) (context.Context, string)
- func Error(ctx context.Context, args ...any)
- func Errorf(ctx context.Context, format string, args ...any)
- func Fatal(ctx context.Context, args ...any)
- func Fatalf(ctx context.Context, format string, args ...any)
- func Info(ctx context.Context, args ...any)
- func Infof(ctx context.Context, format string, args ...any)
- func New(c *config.Config) (func(), error)
- func Panic(ctx context.Context, args ...any)
- func Panicf(ctx context.Context, format string, args ...any)
- func SetOutput(out io.Writer)
- func SetVersion(v string)
- func Trace(ctx context.Context, args ...any)
- func Tracef(ctx context.Context, format string, args ...any)
- func Warn(ctx context.Context, args ...any)
- func Warnf(ctx context.Context, format string, args ...any)
- func WithFields(ctx context.Context, fields logrus.Fields) *logrus.Entry
- type Desensitizer
- type ElasticSearchHook
- type Logger
- func (l *Logger) AddHook(hook logrus.Hook)
- func (l *Logger) Debug(ctx context.Context, args ...any)
- func (l *Logger) Debugf(ctx context.Context, format string, args ...any)
- func (l *Logger) Error(ctx context.Context, args ...any)
- func (l *Logger) Errorf(ctx context.Context, format string, args ...any)
- func (l *Logger) Fatal(ctx context.Context, args ...any)
- func (l *Logger) Fatalf(ctx context.Context, format string, args ...any)
- func (l *Logger) Info(ctx context.Context, args ...any)
- func (l *Logger) Infof(ctx context.Context, format string, args ...any)
- func (l *Logger) Init(c *config.Config) (func(), error)
- func (l *Logger) Panic(ctx context.Context, args ...any)
- func (l *Logger) Panicf(ctx context.Context, format string, args ...any)
- func (l *Logger) SetOutput(out io.Writer)
- func (l *Logger) SetVersion(v string)
- func (l *Logger) Trace(ctx context.Context, args ...any)
- func (l *Logger) Tracef(ctx context.Context, format string, args ...any)
- func (l *Logger) Warn(ctx context.Context, args ...any)
- func (l *Logger) Warnf(ctx context.Context, format string, args ...any)
- type MeiliSearchHook
- type OpenSearchHook
Constants ¶
const ( VersionKey = "version" SpanTitleKey = "title" SpanFunctionKey = "function" )
Key constants
Variables ¶
This section is empty.
Functions ¶
func EnsureTraceID ¶
EnsureTraceID ensures that a trace ID exists in the context.
Types ¶
type Desensitizer ¶ added in v0.1.4
type Desensitizer struct {
// contains filtered or unexported fields
}
Desensitizer handles sensitive data masking in log fields
func NewDesensitizer ¶ added in v0.1.4
func NewDesensitizer(cfg *config.Desensitization) *Desensitizer
NewDesensitizer creates a new desensitizer instance
func (*Desensitizer) DeepDesensitize ¶ added in v0.1.4
func (d *Desensitizer) DeepDesensitize(data any) any
DeepDesensitize provides standalone deep desensitization
func (*Desensitizer) DesensitizeFields ¶ added in v0.1.4
func (d *Desensitizer) DesensitizeFields(fields logrus.Fields) logrus.Fields
DesensitizeFields processes log fields and masks sensitive data
type ElasticSearchHook ¶
type ElasticSearchHook struct {
// contains filtered or unexported fields
}
ElasticSearchHook represents an Elasticsearch log hook
func NewElasticSearchHook ¶ added in v0.1.17
func NewElasticSearchHook(client *elastic.Client, cfg *config.Config) *ElasticSearchHook
NewElasticSearchHook creates new Elasticsearch hook
func (*ElasticSearchHook) Fire ¶
func (h *ElasticSearchHook) Fire(entry *logrus.Entry) error
Fire sends log entry to Elasticsearch
func (*ElasticSearchHook) Levels ¶
func (h *ElasticSearchHook) Levels() []logrus.Level
Levels returns all log levels
type Logger ¶
Logger represents logger instance
func (*Logger) SetVersion ¶
SetVersion sets the version for logging
type MeiliSearchHook ¶
type MeiliSearchHook struct {
// contains filtered or unexported fields
}
MeiliSearchHook represents a MeiliSearch log hook
func NewMeiliSearchHook ¶ added in v0.1.17
func NewMeiliSearchHook(client *meili.Client, cfg *config.Config) *MeiliSearchHook
NewMeiliSearchHook creates new MeiliSearch hook
func (*MeiliSearchHook) Fire ¶
func (h *MeiliSearchHook) Fire(entry *logrus.Entry) error
Fire sends log entry to MeiliSearch
func (*MeiliSearchHook) Levels ¶
func (h *MeiliSearchHook) Levels() []logrus.Level
Levels returns all log levels
type OpenSearchHook ¶ added in v0.1.4
type OpenSearchHook struct {
// contains filtered or unexported fields
}
OpenSearchHook represents an OpenSearch log hook
func NewOpenSearchHook ¶ added in v0.1.17
func NewOpenSearchHook(client *opensearch.Client, cfg *config.Config) *OpenSearchHook
NewOpenSearchHook creates new OpenSearch hook
func (*OpenSearchHook) Fire ¶ added in v0.1.4
func (h *OpenSearchHook) Fire(entry *logrus.Entry) error
Fire sends log entry to OpenSearch
func (*OpenSearchHook) Levels ¶ added in v0.1.4
func (h *OpenSearchHook) Levels() []logrus.Level
Levels returns all log levels