about summary refs log tree commit diff stats
path: root/internal/nats/log.go
diff options
context:
space:
mode:
authorAlan Pearce2024-12-12 11:09:47 +0100
committerAlan Pearce2024-12-12 18:16:10 +0100
commitfed650743913797a314d8fc7d7550ba21dce0a12 (patch)
treec2d5e62fafbf9cee7f862927a5894da807f5d34b /internal/nats/log.go
parentb66c1ed87b556844421886ead373ffdd4ca25663 (diff)
downloadwebsite-fed650743913797a314d8fc7d7550ba21dce0a12.tar.lz
website-fed650743913797a314d8fc7d7550ba21dce0a12.tar.zst
website-fed650743913797a314d8fc7d7550ba21dce0a12.zip
setup embedded NATS cluster nats
Diffstat (limited to 'internal/nats/log.go')
-rw-r--r--internal/nats/log.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/internal/nats/log.go b/internal/nats/log.go
new file mode 100644
index 0000000..cc9d1c2
--- /dev/null
+++ b/internal/nats/log.go
@@ -0,0 +1,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...)
+}