Skip to content

Commit

Permalink
fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
nr-swilloughby committed May 1, 2024
1 parent 3893a8a commit 58afbd4
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 58afbd4

Please sign in to comment.