gologging

package
v0.0.0-...-9823ec8 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package gologging provides a logger implementation based on the github.com/op/go-log pkg

Index

Constants

View Source
const Namespace = "github.com/starvn/sonic/telemetry/gologging"

Variables

View Source
var (
	ErrWrongConfig  = fmt.Errorf("getting the extra config for the sonic/telemetry/gologging package")
	LogstashPattern = `` /* 138-byte string literal not displayed */
	DefaultPattern  = ` %{time:2006/01/02 - 15:04:05.000} %{color}▶ %{level}%{color:reset} %{message}`
	ActivePattern   = DefaultPattern
)

Functions

func ConfigGetter

func ConfigGetter(e config.ExtraConfig) interface{}

func NewLogger

func NewLogger(cfg config.ExtraConfig, ws ...io.Writer) (log.Logger, error)

func SetFormatterSelector

func SetFormatterSelector(f func(io.Writer) string)

Types

type Config

type Config struct {
	Level        string
	StdOut       bool
	Syslog       bool
	Prefix       string
	Format       string
	CustomFormat string
}

type Logger

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

func (Logger) Critical

func (l Logger) Critical(v ...interface{})

func (Logger) Debug

func (l Logger) Debug(v ...interface{})

func (Logger) Error

func (l Logger) Error(v ...interface{})

func (Logger) Fatal

func (l Logger) Fatal(v ...interface{})

func (Logger) Info

func (l Logger) Info(v ...interface{})

func (Logger) Warning

func (l Logger) Warning(v ...interface{})

Jump to

Keyboard shortcuts

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