Documentation ¶
Index ¶
- func AddToContext(ctx context.Context, lg ExtendedSugaredLogger) context.Context
- func AsciiLogo() string
- func Color(text string, color chalk.Color) string
- func ColorEnabled() bool
- func ConfigureApp(app *fiber.App, lg SugaredLogger)
- func NewFasthttpLogger(logger SugaredLogger) fasthttp.Logger
- func NewForPlugin() hclog.Logger
- func NewHCLogger(logger ExtendedSugaredLogger) hclog.Logger
- func TextStyle(text string, textStyle chalk.TextStyle) string
- type ExtendedSugaredLogger
- type LoggerOption
- type LoggerOptions
- type SugaredLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddToContext ¶
func AddToContext(ctx context.Context, lg ExtendedSugaredLogger) context.Context
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
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
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 }
Click to show internal directories.
Click to hide internal directories.