logger

package
v0.6.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultLogLevel = zap.NewAtomicLevelAt(zapcore.DebugLevel)
)

Functions

func AsciiLogo() string

func Color

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

func ColorEnabled

func ColorEnabled() bool

func GinLogger added in v0.5.4

func GinLogger(lg *zap.SugaredLogger) gin.HandlerFunc

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

func NewPluginLogger added in v0.5.4

func NewPluginLogger() ExtendedSugaredLogger

type LoggerOption

type LoggerOption func(*LoggerOptions)

func WithColor

func WithColor(color bool) LoggerOption

func WithDisableCaller added in v0.6.0

func WithDisableCaller() LoggerOption

func WithLogLevel

func WithLogLevel(l zapcore.Level) LoggerOption

func WithSampling

func WithSampling(cfg *zap.SamplingConfig) LoggerOption

func WithTimeEncoder added in v0.6.0

func WithTimeEncoder(enc zapcore.TimeEncoder) 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
}

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