Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mway committed Mar 17, 2023
1 parent ba56da7 commit 656ca5e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -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 \
Expand Down
6 changes: 3 additions & 3 deletions exp/zapslog/slog.go
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand All @@ -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,
Expand Down
20 changes: 20 additions & 0 deletions 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 (
Expand Down

0 comments on commit 656ca5e

Please sign in to comment.