File: slogtest_test.go

package info (click to toggle)
golang-github-chainguard-dev-clog 1.7.0-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 424 kB
  • sloc: makefile: 4
file content (21 lines) | stat: -rw-r--r-- 549 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package slogtest_test

import (
	"testing"

	"github.com/chainguard-dev/clog"
	"github.com/chainguard-dev/clog/slogtest"
)

func TestSlogTest(t *testing.T) {
	ctx := slogtest.Context(t)

	clog.FromContext(ctx).With("foo", "bar").Infof("hello world")
	clog.FromContext(ctx).With("bar", "baz").Infof("me again")
	clog.FromContext(ctx).With("baz", true).Infof("okay last one")

	clog.FromContext(ctx).Debug("hello debug")
	clog.FromContext(ctx).Info("hello info")
	clog.FromContext(ctx).Warn("hello warn")
	clog.FromContext(ctx).Error("hello error")
}