Skip to content

Commit

Permalink
make addsource atomic
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Okhlopkov <[email protected]>
  • Loading branch information
Pavel Okhlopkov committed Oct 23, 2024
1 parent bf4bb51 commit 4885da4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions pkg/unilogger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ type Logger struct {
type Options struct {
handlerOptions

AddSource bool
Level slog.Level
Output io.Writer
Level slog.Level
Output io.Writer

TimeFunc func(t time.Time) time.Time
}
Expand Down
5 changes: 2 additions & 3 deletions pkg/unilogger/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,8 @@ stubArg:
buf := bytes.NewBuffer([]byte{})

logger := unilogger.NewLogger(unilogger.Options{
AddSource: tt.args.addSource,
Level: tt.args.level.Level(),
Output: buf,
Level: tt.args.level.Level(),
Output: buf,
TimeFunc: func(_ time.Time) time.Time {
t, err := time.Parse(time.DateTime, "2006-01-02 15:04:05")
if err != nil {
Expand Down

0 comments on commit 4885da4

Please sign in to comment.