logger

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 15 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsciiLogo() string

func Color

func Color(text string, color chalk.Color) string

func ColorEnabled

func ColorEnabled() bool

func ConfigureAppLogger

func ConfigureAppLogger(app *fiber.App, name string)

func NewFasthttpLogger

func NewFasthttpLogger(name string) fasthttp.Logger

func NewForPlugin

func NewForPlugin() hclog.Logger

func NewHCLogger

func NewHCLogger(logger ExtendedSugaredLogger) hclog.Logger

func TextStyle

func TextStyle(text string, textStyle chalk.TextStyle) string

Types

type ExtendedSugaredLogger

type ExtendedSugaredLogger interface {
	SugaredLogger
	Zap() *zap.SugaredLogger
	AtomicLevel() zap.AtomicLevel
	XWith(args ...interface{}) ExtendedSugaredLogger
	XNamed(name string) ExtendedSugaredLogger
}

func FromContext

func FromContext(ctx context.Context) ExtendedSugaredLogger

func New

type LoggerOption

type LoggerOption func(*LoggerOptions)

func WithColor

func WithColor(color bool) LoggerOption

func WithLogLevel

func WithLogLevel(l zapcore.Level) LoggerOption

func WithSampling

func WithSampling(cfg *zap.SamplingConfig) LoggerOption

func WithWriter

func WithWriter(w io.Writer) LoggerOption

func WithZapOptions

func WithZapOptions(opts ...zap.Option) LoggerOption

type LoggerOptions

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

func (*LoggerOptions) Apply

func (o *LoggerOptions) Apply(opts ...LoggerOption)

type SugaredLogger

type SugaredLogger interface {
	Desugar() *zap.Logger
	Named(name string) *zap.SugaredLogger
	With(args ...interface{}) *zap.SugaredLogger
	Debug(args ...interface{})
	Info(args ...interface{})
	Warn(args ...interface{})
	Error(args ...interface{})
	DPanic(args ...interface{})
	Panic(args ...interface{})
	Fatal(args ...interface{})
	Debugf(template string, args ...interface{})
	Infof(template string, args ...interface{})
	Warnf(template string, args ...interface{})
	Errorf(template string, args ...interface{})
	DPanicf(template string, args ...interface{})
	Panicf(template string, args ...interface{})
	Fatalf(template string, args ...interface{})
	Debugw(msg string, keysAndValues ...interface{})
	Infow(msg string, keysAndValues ...interface{})
	Warnw(msg string, keysAndValues ...interface{})
	Errorw(msg string, keysAndValues ...interface{})
	DPanicw(msg string, keysAndValues ...interface{})
	Panicw(msg string, keysAndValues ...interface{})
	Fatalw(msg string, keysAndValues ...interface{})
	Sync() error
}

Jump to

Keyboard shortcuts

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