Skip to content

Commit

Permalink
add newline to devslog
Browse files Browse the repository at this point in the history
Signed-off-by: Kit Patella <[email protected]>
  • Loading branch information
mkcp committed Oct 23, 2024
1 parent f383f2d commit 67c96a8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pkg/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ package logger
import (
"context"
"fmt"
"github.com/golang-cz/devslog"
"io"
"log/slog"
"os"
"strings"
"sync/atomic"

"github.com/golang-cz/devslog"
)

var defaultLogger atomic.Pointer[slog.Logger]
Expand Down Expand Up @@ -137,7 +138,10 @@ func New(cfg Config) (*slog.Logger, error) {
handler = slog.NewJSONHandler(cfg.Destination, &opts)
case FormatDev:
opts.AddSource = true
handler = devslog.NewHandler(DestinationDefault, &devslog.Options{HandlerOptions: &opts})
handler = devslog.NewHandler(DestinationDefault, &devslog.Options{
HandlerOptions: &opts,
NewLineAfterLog: true,
})
case FormatNone:
handler = slog.NewTextHandler(DestinationNone, &slog.HandlerOptions{})
// Format not found, let's error out
Expand Down

0 comments on commit 67c96a8

Please sign in to comment.