diff --git a/Makefile b/Makefile index e1af62626..518c3fa6b 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ BENCH_FLAGS ?= -cpuprofile=cpu.pprof -memprofile=mem.pprof -benchmem # Directories containing independent Go modules. # # We track coverage only for the main module. -MODULE_DIRS = . ./benchmarks ./zapgrpc/internal/test +MODULE_DIRS = . ./exp ./benchmarks ./zapgrpc/internal/test # Many Go tools take file globs or directories as arguments instead of packages. GO_FILES := $(shell \ diff --git a/exp/zapslog/slog.go b/exp/zapslog/slog.go index bf055cc07..20de57b8d 100644 --- a/exp/zapslog/slog.go +++ b/exp/zapslog/slog.go @@ -100,7 +100,7 @@ func convertAttrToField(attr slog.Attr) zapcore.Field { case slog.KindLogValuer: return convertAttrToField(slog.Attr{ Key: attr.Key, - // FIXME(knight42): resolve the value in a lazy way + // TODO: resolve the value in a lazy way Value: attr.Value.Resolve(), }) default: @@ -136,7 +136,7 @@ func (h *Handler) Handle(ctx context.Context, record slog.Record) error { Time: record.Time, Message: record.Message, LoggerName: h.name, - // FIXME: do we need to set the following fields? + // TODO: do we need to set the following fields? // Stack: } ce := h.core.Check(ent, nil) @@ -146,7 +146,7 @@ func (h *Handler) Handle(ctx context.Context, record slog.Record) error { if h.addSource { frame, _ := runtime.CallersFrames([]uintptr{record.PC}).Next() - ce.Entry.Caller = zapcore.EntryCaller{ + ce.Caller = zapcore.EntryCaller{ Defined: true, PC: frame.PC, File: frame.File, diff --git a/exp/zapslog/slog_test.go b/exp/zapslog/slog_test.go index 2d87a72ca..2ef3a0d81 100644 --- a/exp/zapslog/slog_test.go +++ b/exp/zapslog/slog_test.go @@ -1,3 +1,23 @@ +// Copyright (c) 2023 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + package zapslog import (