Skip to content

Commit

Permalink
Merge pull request #910 from nr-swilloughby/nrslog-patch
Browse files Browse the repository at this point in the history
fix example in nrslog
  • Loading branch information
nr-swilloughby committed May 1, 2024
2 parents 3893a8a + 58afbd4 commit 0aa392d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions v3/integrations/logcontext-v2/nrslog/example/main.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package main

import (
"context"
"log/slog"
"os"
"time"
"context"

"github.com/newrelic/go-agent/v3/integrations/logcontext-v2/nrslog"
"github.com/newrelic/go-agent/v3/newrelic"
Expand All @@ -26,12 +26,12 @@ func main() {

txn := app.StartTransaction("example transaction")
ctx := newrelic.NewContext(context.Background(), txn)
txnLogger.InfoContext(ctx, "I am a log inside a transaction")

log.InfoContext(ctx, "I am a log inside a transaction")

// pretend to do some work
time.Sleep(500 * time.Millisecond)
txnLogger.Warn("Uh oh, something important happened!")
log.Warn("Uh oh, something important happened!")
txn.End()

log.Info("All Done!")
Expand Down

0 comments on commit 0aa392d

Please sign in to comment.