Documentation ¶
Index ¶
- Variables
- func AddToContext(ctx context.Context, lg ExtendedSugaredLogger) context.Context
- func AsciiLogo() string
- func Color(text string, color chalk.Color) string
- func ColorEnabled() bool
- func GinLogger(lg *zap.SugaredLogger) gin.HandlerFunc
- func NewForPlugin() hclog.Logger
- func TextStyle(text string, textStyle chalk.TextStyle) string
- type ExtendedSugaredLogger
- type LoggerOption
- func WithColor(color bool) LoggerOption
- func WithDisableCaller() LoggerOption
- func WithLogLevel(l zapcore.Level) LoggerOption
- func WithSampling(cfg *zap.SamplingConfig) LoggerOption
- func WithTimeEncoder(enc zapcore.TimeEncoder) LoggerOption
- func WithWriter(w io.Writer) LoggerOption
- func WithZapOptions(opts ...zap.Option) LoggerOption
- type LoggerOptions
- type SugaredLogger
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultLogLevel = zap.NewAtomicLevelAt(zapcore.DebugLevel)
)
Functions ¶
func AddToContext ¶
func AddToContext(ctx context.Context, lg ExtendedSugaredLogger) context.Context
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
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 New(opts ...LoggerOption) ExtendedSugaredLogger
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 }
Click to show internal directories.
Click to hide internal directories.