about summary refs log tree commit diff stats
path: root/internal/nats/log.go
blob: cc9d1c202cfd566ab9e56035274f743186cf09a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package nats

import (
	"go.alanpearce.eu/x/log"
	"go.uber.org/zap"
)

type Logger struct {
	*zap.SugaredLogger
}

func adaptLogger(log *log.Logger) *Logger {
	if log == nil {
		panic("zl cannot be nil")
	}
	return &Logger{
		log.GetLogger().Sugar(),
	}
}

func (l *Logger) Tracef(format string, v ...any) {
	l.Debugf(format, v...)
}

func (l *Logger) Noticef(format string, v ...any) {
	l.Infof(format, v...)
}