From dc06a444687083d0c30ecbdf2a9338e5eb04c76a Mon Sep 17 00:00:00 2001 From: dimagolomozy Date: Mon, 15 Apr 2024 16:11:56 +0300 Subject: [PATCH] make pointer --- slog_handler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slog_handler.go b/slog_handler.go index 524e9c6..a0e2d7a 100644 --- a/slog_handler.go +++ b/slog_handler.go @@ -23,7 +23,7 @@ type source struct { type logMessage struct { Message string `json:"message"` Data map[string]any `json:"data,omitempty"` - Source source `json:"source,omitempty"` + Source *source `json:"source,omitempty"` } func NewCoralogixHandler(privateKey, applicationName, subsystemName string, opts *slog.HandlerOptions) *CoralogixHandler { @@ -76,7 +76,7 @@ func (h *CoralogixHandler) Handle(ctx context.Context, r slog.Record) error { } if h.opts.AddSource { - log.Source = source{ + log.Source = &source{ Function: f.Function, File: f.File, Line: f.Line,