Documentation
ΒΆ
Index ΒΆ
- Constants
- func CtxDebug(c context.Context, v ...interface{})
- func CtxDebugf(c context.Context, f string, v ...interface{})
- func CtxError(c context.Context, v ...interface{})
- func CtxErrorf(c context.Context, f string, v ...interface{})
- func CtxFatal(c context.Context, v ...interface{})
- func CtxFatalf(c context.Context, f string, v ...interface{})
- func CtxInfo(c context.Context, v ...interface{})
- func CtxInfof(c context.Context, f string, v ...interface{})
- func CtxNotice(c context.Context, v ...interface{})
- func CtxNoticef(c context.Context, f string, v ...interface{})
- func CtxTrace(c context.Context, v ...interface{})
- func CtxTracef(c context.Context, f string, v ...interface{})
- func CtxWarn(c context.Context, v ...interface{})
- func CtxWarnf(c context.Context, f string, v ...interface{})
- func Debug(v ...interface{})
- func DebugEvent() *zerolog.Event
- func Debugf(f string, v ...interface{})
- func Error(v ...interface{})
- func ErrorEvent() *zerolog.Event
- func Errorf(f string, v ...interface{})
- func Fatal(v ...interface{})
- func FatalEvent() *zerolog.Event
- func Fatalf(f string, v ...interface{})
- func Info(v ...interface{})
- func InfoEvent() *zerolog.Event
- func Infof(f string, v ...interface{})
- func InitLogger(_, _, _ string)
- func NewHlogAdapter(logger *Logger) hlog.FullLogger
- func Notice(v ...interface{})
- func Noticef(f string, v ...interface{})
- func PanicEvent() *zerolog.Event
- func SetHertzLogger(logger *Logger)
- func SetLevel(level Level)
- func SetOutput(w io.Writer)
- func Sync(w io.Writer) error
- func Trace(v ...interface{})
- func Tracef(f string, v ...interface{})
- func Warn(v ...interface{})
- func WarnEvent() *zerolog.Event
- func Warnf(f string, v ...interface{})
- func With() zerolog.Context
- func WithContext(ctx context.Context) context.Context
- type BatchStats
- type BatchedCentralizedWriter
- type Config
- func (c *Config) IsDevelopment() bool
- func (c *Config) IsProduction() bool
- func (c *Config) IsStaging() bool
- func (c *Config) ShouldUseCentralizedWriter() bool
- func (c *Config) ShouldUseConsoleWriter() bool
- func (c *Config) ShouldUseFileWriter() bool
- func (c *Config) Validate() error
- func (c *Config) ValidateOrPanic()
- type Control
- type CtxLogger
- type FormatLogger
- type FullLogger
- type HlogAdapter
- func (a *HlogAdapter) CtxDebug(ctx context.Context, v ...interface{})
- func (a *HlogAdapter) CtxDebugf(ctx context.Context, format string, v ...interface{})
- func (a *HlogAdapter) CtxError(ctx context.Context, v ...interface{})
- func (a *HlogAdapter) CtxErrorf(ctx context.Context, format string, v ...interface{})
- func (a *HlogAdapter) CtxFatal(ctx context.Context, v ...interface{})
- func (a *HlogAdapter) CtxFatalf(ctx context.Context, format string, v ...interface{})
- func (a *HlogAdapter) CtxInfo(ctx context.Context, v ...interface{})
- func (a *HlogAdapter) CtxInfof(ctx context.Context, format string, v ...interface{})
- func (a *HlogAdapter) CtxNotice(ctx context.Context, v ...interface{})
- func (a *HlogAdapter) CtxNoticef(ctx context.Context, format string, v ...interface{})
- func (a *HlogAdapter) CtxTrace(ctx context.Context, v ...interface{})
- func (a *HlogAdapter) CtxTracef(ctx context.Context, format string, v ...interface{})
- func (a *HlogAdapter) CtxWarn(ctx context.Context, v ...interface{})
- func (a *HlogAdapter) CtxWarnf(ctx context.Context, format string, v ...interface{})
- func (a *HlogAdapter) Debug(v ...interface{})
- func (a *HlogAdapter) Debugf(format string, v ...interface{})
- func (a *HlogAdapter) Error(v ...interface{})
- func (a *HlogAdapter) Errorf(format string, v ...interface{})
- func (a *HlogAdapter) Fatal(v ...interface{})
- func (a *HlogAdapter) Fatalf(format string, v ...interface{})
- func (a *HlogAdapter) Info(v ...interface{})
- func (a *HlogAdapter) Infof(format string, v ...interface{})
- func (a *HlogAdapter) Notice(v ...interface{})
- func (a *HlogAdapter) Noticef(format string, v ...interface{})
- func (a *HlogAdapter) SetLevel(level hlog.Level)
- func (a *HlogAdapter) SetOutput(w io.Writer)
- func (a *HlogAdapter) Trace(v ...interface{})
- func (a *HlogAdapter) Tracef(format string, v ...interface{})
- func (a *HlogAdapter) Warn(v ...interface{})
- func (a *HlogAdapter) Warnf(format string, v ...interface{})
- type Level
- type Logger
- func (l *Logger) CtxDebug(ctx context.Context, v ...interface{})
- func (l *Logger) CtxDebugf(ctx context.Context, format string, v ...interface{})
- func (l *Logger) CtxError(ctx context.Context, v ...interface{})
- func (l *Logger) CtxErrorf(ctx context.Context, format string, v ...interface{})
- func (l *Logger) CtxFatal(ctx context.Context, v ...interface{})
- func (l *Logger) CtxFatalf(ctx context.Context, format string, v ...interface{})
- func (l *Logger) CtxInfo(ctx context.Context, v ...interface{})
- func (l *Logger) CtxInfof(ctx context.Context, format string, v ...interface{})
- func (l *Logger) CtxNotice(ctx context.Context, v ...interface{})
- func (l *Logger) CtxNoticef(ctx context.Context, format string, v ...interface{})
- func (l *Logger) CtxTrace(ctx context.Context, v ...interface{})
- func (l *Logger) CtxTracef(ctx context.Context, format string, v ...interface{})
- func (l *Logger) CtxWarn(ctx context.Context, v ...interface{})
- func (l *Logger) CtxWarnf(ctx context.Context, format string, v ...interface{})
- func (l *Logger) Debug(v ...interface{})
- func (l *Logger) DebugEvent() *zerolog.Event
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Error(v ...interface{})
- func (l *Logger) ErrorEvent() *zerolog.Event
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Fatal(v ...interface{})
- func (l *Logger) FatalEvent() *zerolog.Event
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) Info(v ...interface{})
- func (l *Logger) InfoEvent() *zerolog.Event
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) LogCacheOperation(op, key string, hit bool, dur time.Duration)
- func (l *Logger) LogDatabaseQuery(q string, dur time.Duration, err error)
- func (l *Logger) LogHTTPRequest(method, path string, status int, dur time.Duration, ip string)
- func (l *Logger) Notice(v ...interface{})
- func (l *Logger) Noticef(format string, v ...interface{})
- func (l *Logger) PanicEvent() *zerolog.Event
- func (l *Logger) SetLevel(lv Level)
- func (l *Logger) SetOutput(w io.Writer)
- func (l *Logger) Shutdown() error
- func (l *Logger) Trace(v ...interface{})
- func (l *Logger) TraceEvent() *zerolog.Event
- func (l *Logger) Tracef(format string, v ...interface{})
- func (l *Logger) Warn(v ...interface{})
- func (l *Logger) WarnEvent() *zerolog.Event
- func (l *Logger) Warnf(format string, v ...interface{})
- func (l *Logger) With() zerolog.Context
- func (l *Logger) WithContext(ctx context.Context) context.Context
- type LoggerInterface
- type MetricsRecorder
- type NoOpMetricsRecorder
- type OutputType
- type ScrubberWriter
- type SensitiveDataScrubber
- func (s *SensitiveDataScrubber) AddPattern(name string, pattern *regexp.Regexp)
- func (s *SensitiveDataScrubber) IsEnabled() bool
- func (s *SensitiveDataScrubber) RemovePattern(name string)
- func (s *SensitiveDataScrubber) Scrub(input string) string
- func (s *SensitiveDataScrubber) ScrubBytes(input []byte) []byte
- func (s *SensitiveDataScrubber) ScrubMap(m map[string]interface{}) map[string]interface{}
- func (s *SensitiveDataScrubber) SetEnabled(enabled bool)
- type SyncWriter
- type Writers
Constants ΒΆ
const Version = "1.0.9"
Version of the turbolog package
Variables ΒΆ
This section is empty.
Functions ΒΆ
func CtxNoticef ΒΆ added in v1.0.2
func DebugEvent ΒΆ added in v1.0.2
func ErrorEvent ΒΆ added in v1.0.2
func FatalEvent ΒΆ added in v1.0.2
func InitLogger ΒΆ
func InitLogger(_, _, _ string)
func NewHlogAdapter ΒΆ added in v1.0.2
func NewHlogAdapter(logger *Logger) hlog.FullLogger
NewHlogAdapter creates a new adapter for Hertz hlog compatibility
func PanicEvent ΒΆ added in v1.0.2
func SetHertzLogger ΒΆ added in v1.0.2
func SetHertzLogger(logger *Logger)
SetHertzLogger sets the logger for Hertz framework Usage: hlog.SetLogger(turbolog.NewHlogAdapter(logger))
func SetLevel ΒΆ added in v1.0.2
func SetLevel(level Level)
SetLevel sets the log level for the default logger
Types ΒΆ
type BatchStats ΒΆ
type BatchStats struct {
TotalSent int64
TotalFailed int64
DroppedCount int64
BufferSize int
LastSendTime time.Time
}
BatchStats holds statistics about the batched writer
type BatchedCentralizedWriter ΒΆ
type BatchedCentralizedWriter struct {
// contains filtered or unexported fields
}
BatchedCentralizedWriter buffers log entries and sends them in batches
func NewBatchedCentralizedWriter ΒΆ
func NewBatchedCentralizedWriter(url string, batchSize int, timeout time.Duration, retries int, scrubber *SensitiveDataScrubber) *BatchedCentralizedWriter
NewBatchedCentralizedWriter creates a new batched centralized writer
func (*BatchedCentralizedWriter) Close ΒΆ
func (w *BatchedCentralizedWriter) Close() error
Close flushes remaining logs and stops the background flusher
func (*BatchedCentralizedWriter) GetStats ΒΆ
func (w *BatchedCentralizedWriter) GetStats() BatchStats
GetStats returns current statistics
func (*BatchedCentralizedWriter) Health ΒΆ added in v1.0.2
func (w *BatchedCentralizedWriter) Health() error
Health checks the health of the batch writer
type Config ΒΆ
type Config struct {
// General settings
Level Level `json:"level"`
Format string `json:"format"`
Output OutputType `json:"output"`
// File logging settings
FileEnabled bool `json:"file_enabled"`
FilePath string `json:"file_path"`
FileMaxSize int `json:"file_max_size"`
FileMaxAge int `json:"file_max_age"`
FileMaxBackups int `json:"file_max_backups"`
FileCompress bool `json:"file_compress"`
// Centralized logging
CentralizedEnabled bool `json:"centralized_enabled"`
CentralizedURL string `json:"centralized_url"`
// Performance settings
UseDialode bool `json:"use_diode"`
DiodeBufferSize int `json:"diode_buffer_size"` // Buffer size for diode (default: 1000)
DiodePollingInterval time.Duration `json:"diode_polling_interval"` // Polling interval for diode (default: 10ms)
SamplingEnabled bool `json:"sampling_enabled"`
SampleRate int `json:"sample_rate"`
SamplingBurst int `json:"sampling_burst"`
SamplingPeriod time.Duration `json:"sampling_period"`
// Development features
CallerEnabled bool `json:"caller_enabled"`
ColorEnabled bool `json:"color_enabled"`
PrettyPrint bool `json:"pretty_print"`
// Security features
ScrubSensitiveData bool `json:"scrub_sensitive_data"`
// Batching settings for centralized logging
BatchEnabled bool `json:"batch_enabled"`
BatchSize int `json:"batch_size"`
BatchTimeout time.Duration `json:"batch_timeout"`
BatchRetries int `json:"batch_retries"`
// Environment
Environment string `json:"environment"`
// Observability
MetricsRecorder MetricsRecorder `json:"-"` // Metrics backend (Prometheus, OpenTelemetry, etc.)
}
Config holds the logger configuration
func LoadConfig ΒΆ
func LoadConfig() *Config
LoadConfig loads logger configuration from environment variables Starts with NewConfig() defaults and overrides with env vars
func NewConfig ΒΆ added in v1.0.8
func NewConfig() *Config
NewConfig returns a new config with sensible defaults Users should customize this based on their needs
func (*Config) IsDevelopment ΒΆ
IsDevelopment checks if the environment is development
func (*Config) IsProduction ΒΆ
IsProduction checks if the environment is production
func (*Config) ShouldUseCentralizedWriter ΒΆ
ShouldUseCentralizedWriter checks if centralized writer should be used
func (*Config) ShouldUseConsoleWriter ΒΆ
ShouldUseConsoleWriter checks if console writer should be used
func (*Config) ShouldUseFileWriter ΒΆ
ShouldUseFileWriter checks if file writer should be used
func (*Config) ValidateOrPanic ΒΆ
func (c *Config) ValidateOrPanic()
ValidateOrPanic validates the configuration and panics if invalid
type CtxLogger ΒΆ added in v1.0.2
type CtxLogger interface {
CtxTracef(ctx context.Context, format string, v ...interface{})
CtxDebugf(ctx context.Context, format string, v ...interface{})
CtxInfof(ctx context.Context, format string, v ...interface{})
CtxNoticef(ctx context.Context, format string, v ...interface{})
CtxWarnf(ctx context.Context, format string, v ...interface{})
CtxErrorf(ctx context.Context, format string, v ...interface{})
CtxFatalf(ctx context.Context, format string, v ...interface{})
}
CtxLogger is a logger interface that provides context-aware logging
type FormatLogger ΒΆ added in v1.0.2
type FormatLogger interface {
Tracef(format string, v ...interface{})
Debugf(format string, v ...interface{})
Infof(format string, v ...interface{})
Noticef(format string, v ...interface{})
Warnf(format string, v ...interface{})
Errorf(format string, v ...interface{})
Fatalf(format string, v ...interface{})
}
FormatLogger is a logger interface that provides formatted logging
type FullLogger ΒΆ added in v1.0.2
type FullLogger interface {
LoggerInterface
FormatLogger
CtxLogger
Control
}
FullLogger is the combination of Logger, FormatLogger, CtxLogger and Control This interface is 100% compatible with Hertz's hlog.FullLogger
type HlogAdapter ΒΆ added in v1.0.2
type HlogAdapter struct {
// contains filtered or unexported fields
}
HlogAdapter adapts turbolog.Logger to work with Hertz's hlog interface
func (*HlogAdapter) CtxDebug ΒΆ added in v1.0.9
func (a *HlogAdapter) CtxDebug(ctx context.Context, v ...interface{})
func (*HlogAdapter) CtxDebugf ΒΆ added in v1.0.2
func (a *HlogAdapter) CtxDebugf(ctx context.Context, format string, v ...interface{})
func (*HlogAdapter) CtxError ΒΆ added in v1.0.9
func (a *HlogAdapter) CtxError(ctx context.Context, v ...interface{})
func (*HlogAdapter) CtxErrorf ΒΆ added in v1.0.2
func (a *HlogAdapter) CtxErrorf(ctx context.Context, format string, v ...interface{})
func (*HlogAdapter) CtxFatal ΒΆ added in v1.0.9
func (a *HlogAdapter) CtxFatal(ctx context.Context, v ...interface{})
func (*HlogAdapter) CtxFatalf ΒΆ added in v1.0.2
func (a *HlogAdapter) CtxFatalf(ctx context.Context, format string, v ...interface{})
func (*HlogAdapter) CtxInfo ΒΆ added in v1.0.9
func (a *HlogAdapter) CtxInfo(ctx context.Context, v ...interface{})
func (*HlogAdapter) CtxInfof ΒΆ added in v1.0.2
func (a *HlogAdapter) CtxInfof(ctx context.Context, format string, v ...interface{})
func (*HlogAdapter) CtxNotice ΒΆ added in v1.0.9
func (a *HlogAdapter) CtxNotice(ctx context.Context, v ...interface{})
func (*HlogAdapter) CtxNoticef ΒΆ added in v1.0.2
func (a *HlogAdapter) CtxNoticef(ctx context.Context, format string, v ...interface{})
func (*HlogAdapter) CtxTrace ΒΆ added in v1.0.9
func (a *HlogAdapter) CtxTrace(ctx context.Context, v ...interface{})
Context-aware structured logging (non-formatted)
func (*HlogAdapter) CtxTracef ΒΆ added in v1.0.2
func (a *HlogAdapter) CtxTracef(ctx context.Context, format string, v ...interface{})
Context-aware formatted logging
func (*HlogAdapter) CtxWarn ΒΆ added in v1.0.9
func (a *HlogAdapter) CtxWarn(ctx context.Context, v ...interface{})
func (*HlogAdapter) CtxWarnf ΒΆ added in v1.0.2
func (a *HlogAdapter) CtxWarnf(ctx context.Context, format string, v ...interface{})
func (*HlogAdapter) Debug ΒΆ added in v1.0.2
func (a *HlogAdapter) Debug(v ...interface{})
func (*HlogAdapter) Debugf ΒΆ added in v1.0.2
func (a *HlogAdapter) Debugf(format string, v ...interface{})
func (*HlogAdapter) Error ΒΆ added in v1.0.2
func (a *HlogAdapter) Error(v ...interface{})
func (*HlogAdapter) Errorf ΒΆ added in v1.0.2
func (a *HlogAdapter) Errorf(format string, v ...interface{})
func (*HlogAdapter) Fatal ΒΆ added in v1.0.2
func (a *HlogAdapter) Fatal(v ...interface{})
func (*HlogAdapter) Fatalf ΒΆ added in v1.0.2
func (a *HlogAdapter) Fatalf(format string, v ...interface{})
func (*HlogAdapter) Info ΒΆ added in v1.0.2
func (a *HlogAdapter) Info(v ...interface{})
func (*HlogAdapter) Infof ΒΆ added in v1.0.2
func (a *HlogAdapter) Infof(format string, v ...interface{})
func (*HlogAdapter) Notice ΒΆ added in v1.0.2
func (a *HlogAdapter) Notice(v ...interface{})
func (*HlogAdapter) Noticef ΒΆ added in v1.0.2
func (a *HlogAdapter) Noticef(format string, v ...interface{})
func (*HlogAdapter) SetLevel ΒΆ added in v1.0.2
func (a *HlogAdapter) SetLevel(level hlog.Level)
Control methods
func (*HlogAdapter) SetOutput ΒΆ added in v1.0.2
func (a *HlogAdapter) SetOutput(w io.Writer)
func (*HlogAdapter) Trace ΒΆ added in v1.0.2
func (a *HlogAdapter) Trace(v ...interface{})
Regular logging methods
func (*HlogAdapter) Tracef ΒΆ added in v1.0.2
func (a *HlogAdapter) Tracef(format string, v ...interface{})
Formatted logging methods
func (*HlogAdapter) Warn ΒΆ added in v1.0.2
func (a *HlogAdapter) Warn(v ...interface{})
func (*HlogAdapter) Warnf ΒΆ added in v1.0.2
func (a *HlogAdapter) Warnf(format string, v ...interface{})
type Level ΒΆ added in v1.0.2
type Level int
Level represents the logging level (hlog compatible)
func ParseLevel ΒΆ added in v1.0.2
ParseLevel parses a string into a Level
type Logger ΒΆ
type Logger struct {
// HOT PATH (frequently accessed together - fits in single cache line)
*zerolog.Logger // 8 bytes - pointer to logger
// contains filtered or unexported fields
}
func FromContext ΒΆ
func InitWithConfig ΒΆ
func (*Logger) CtxNoticef ΒΆ added in v1.0.2
func (*Logger) DebugEvent ΒΆ added in v1.0.2
func (*Logger) ErrorEvent ΒΆ added in v1.0.2
func (*Logger) FatalEvent ΒΆ added in v1.0.2
func (*Logger) LogCacheOperation ΒΆ
func (*Logger) LogDatabaseQuery ΒΆ
func (*Logger) LogHTTPRequest ΒΆ
func (*Logger) PanicEvent ΒΆ added in v1.0.2
func (*Logger) TraceEvent ΒΆ added in v1.0.2
type LoggerInterface ΒΆ added in v1.0.2
type LoggerInterface interface {
Trace(v ...interface{})
Debug(v ...interface{})
Info(v ...interface{})
Notice(v ...interface{})
Warn(v ...interface{})
Error(v ...interface{})
Fatal(v ...interface{})
}
LoggerInterface is a logger interface that provides logging function with levels
type MetricsRecorder ΒΆ added in v1.0.8
type MetricsRecorder interface {
// IncLog increments the log counter for the given level.
// Called after each successful log write.
//
// Example metric: turbolog_logs_total{level="info"} 1234
IncLog(level Level)
// IncDropped increments the dropped message counter.
// Called when logs are dropped due to buffer capacity.
//
// Parameters:
// - count: number of messages dropped
// - reason: why messages were dropped (e.g., "diode_buffer_full", "batch_buffer_full")
//
// Example metric: turbolog_dropped_total{reason="diode_buffer_full"} 42
IncDropped(count int, reason string)
// IncError increments the error counter for logging infrastructure.
// Called when internal logging operations fail.
//
// Parameters:
// - operation: which operation failed (e.g., "batch_write", "file_write", "scrubber")
//
// Example metric: turbolog_errors_total{operation="batch_write"} 5
IncError(operation string)
}
MetricsRecorder provides an interface for recording logging metrics. This allows integration with monitoring systems like Prometheus, OpenTelemetry, StatsD, etc.
The interface is designed to be: - Optional: Uses no-op implementation by default (zero overhead) - Pluggable: Easy to implement for any metrics backend - Low overhead: Counter-based operations only (no allocations) - Non-blocking: Implementations should not block logging operations
Example usage with Prometheus:
type PrometheusRecorder struct {
logsTotal *prometheus.CounterVec
droppedTotal *prometheus.CounterVec
errorsTotal *prometheus.CounterVec
}
func (p *PrometheusRecorder) IncLog(level Level) {
p.logsTotal.WithLabelValues(level.String()).Inc()
}
type NoOpMetricsRecorder ΒΆ added in v1.0.8
type NoOpMetricsRecorder struct{}
NoOpMetricsRecorder is a no-op implementation of MetricsRecorder. Used by default when metrics are not configured. All methods are empty inline functions with zero overhead.
func (*NoOpMetricsRecorder) IncDropped ΒΆ added in v1.0.8
func (n *NoOpMetricsRecorder) IncDropped(_ int, _ string)
IncDropped does nothing (no-op).
func (*NoOpMetricsRecorder) IncError ΒΆ added in v1.0.8
func (n *NoOpMetricsRecorder) IncError(_ string)
IncError does nothing (no-op).
func (*NoOpMetricsRecorder) IncLog ΒΆ added in v1.0.8
func (n *NoOpMetricsRecorder) IncLog(_ Level)
IncLog does nothing (no-op).
type OutputType ΒΆ
type OutputType string
OutputType represents where logs should be written
const ( StdoutOutput OutputType = "stdout" FileOutput OutputType = "file" BothOutput OutputType = "both" CentralizedOutput OutputType = "centralized" )
type ScrubberWriter ΒΆ
type ScrubberWriter struct {
// contains filtered or unexported fields
}
ScrubberWriter wraps an io.Writer with sensitive data scrubbing
func NewScrubberWriter ΒΆ
func NewScrubberWriter(writer io.Writer, scrubber *SensitiveDataScrubber) *ScrubberWriter
NewScrubberWriter creates a new scrubber writer
type SensitiveDataScrubber ΒΆ
type SensitiveDataScrubber struct {
// contains filtered or unexported fields
}
SensitiveDataScrubber removes sensitive information from log messages
func NewSensitiveDataScrubber ΒΆ
func NewSensitiveDataScrubber(enabled bool) *SensitiveDataScrubber
NewSensitiveDataScrubber creates a new scrubber with default patterns
func (*SensitiveDataScrubber) AddPattern ΒΆ
func (s *SensitiveDataScrubber) AddPattern(name string, pattern *regexp.Regexp)
AddPattern adds a custom scrubbing pattern
func (*SensitiveDataScrubber) IsEnabled ΒΆ
func (s *SensitiveDataScrubber) IsEnabled() bool
IsEnabled returns whether the scrubber is enabled
func (*SensitiveDataScrubber) RemovePattern ΒΆ
func (s *SensitiveDataScrubber) RemovePattern(name string)
RemovePattern removes a scrubbing pattern
func (*SensitiveDataScrubber) Scrub ΒΆ
func (s *SensitiveDataScrubber) Scrub(input string) string
Scrub removes sensitive data from the input string
func (*SensitiveDataScrubber) ScrubBytes ΒΆ
func (s *SensitiveDataScrubber) ScrubBytes(input []byte) []byte
ScrubBytes scrubs sensitive data from byte slice
func (*SensitiveDataScrubber) ScrubMap ΒΆ
func (s *SensitiveDataScrubber) ScrubMap(m map[string]interface{}) map[string]interface{}
ScrubMap scrubs sensitive data from map values
func (*SensitiveDataScrubber) SetEnabled ΒΆ
func (s *SensitiveDataScrubber) SetEnabled(enabled bool)
SetEnabled enables or disables the scrubber
type SyncWriter ΒΆ
type SyncWriter interface {
Sync() error
}
SyncWriter ensures all logs are flushed (call on shutdown)