logger

package
v0.0.0-...-c8afd98 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

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 ConfigureApp

func ConfigureApp(app *fiber.App, lg SugaredLogger)

func NewFasthttpLogger

func NewFasthttpLogger(logger SugaredLogger) 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 WithWriter

func WithWriter(w io.Writer) 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