Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLoggerLevel ¶
Types ¶
type Logger ¶
type Logger interface { Info(message Message) Warn(message Message) Error(message Message) Debug(message Message) StandardLogger() StandardLogger }
type Masked ¶
if Aliasing is filled will replace all value with Aliasing value Fill StartIdx and EndIdx with 0 to masked all value with Pattern example: { Key: Value } Aliasing: ***, Pattern: *, StartIdx: 0, EndIdx: 0 -> { Key: *** } Pattern: *, Skipper.First: 0, Skipper.Last: 0 -> { Key: ***** } Pattern: -, Skipper.First: 1, Skipper.Last: 2 -> { Key: V--ue } Pattern: *, Skipper.First: 3, Skipper.Last: 3 -> { Key: Value }
type MaskedEncoder ¶
func (MaskedEncoder) Encode ¶
func (masked MaskedEncoder) Encode(key string, data interface{}) interface{}
type Message ¶
type Message map[string]interface{}
func BuildMessage ¶
func BuildMessage(ctx context.Context, msg string, opts ...MessageOption) Message
func (Message) MarshalJSON ¶
func (Message) MarshalText ¶
type MessageOption ¶
type MessageOption interface {
Apply(o *messageOptions)
}
func WithAttr ¶
func WithAttr(key string, value interface{}) MessageOption
WithAttr function to add attributes to messages
func WithMasking ¶
func WithMasking(key string, masked Masked) MessageOption
WithMasking function to add masking specific key to messages
type StandardLogger ¶
type StandardLogger interface { Output() io.Writer SetOutput(w io.Writer) Prefix() string SetPrefix(prefix string) Level() log.Lvl SetLevel(v log.Lvl) SetHeader(header string) Print(i ...interface{}) Println(i ...interface{}) Printf(format string, i ...interface{}) Printj(j log.JSON) Debug(i ...interface{}) Debugf(format string, i ...interface{}) Debugj(j log.JSON) Info(i ...interface{}) Infof(format string, i ...interface{}) Infoj(j log.JSON) Warn(i ...interface{}) Warnf(format string, i ...interface{}) Warnj(j log.JSON) Error(i ...interface{}) Errorf(format string, i ...interface{}) Errorj(j log.JSON) Fatal(i ...interface{}) Fatalf(format string, i ...interface{}) Fatalj(j log.JSON) Panic(i ...interface{}) Panicf(format string, i ...interface{}) Panicj(j log.JSON) Instance() interface{} Log(msg string) }
Click to show internal directories.
Click to hide internal directories.