Skip to content

Commit

Permalink
Start using slog
Browse files Browse the repository at this point in the history
  • Loading branch information
rogeralsing committed Nov 19, 2023
1 parent a2e6f77 commit b182f32
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
3 changes: 2 additions & 1 deletion _examples/actor-jaegertracing/router/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ func main() {
NewRootContext(actorSystem, nil).
WithSpawnMiddleware(opentracing.TracingMiddleware())

pid := rootContext.SpawnPrefix(createProps(router.NewRoundRobinPool, 3), "root")
f := router.NewRoundRobinPool
pid := rootContext.SpawnPrefix(createProps(f, 3), "root")
for i := 0; i < 3; i++ {
_ = rootContext.RequestFuture(pid, &request{i}, 10*time.Second).Wait()
}
Expand Down
29 changes: 29 additions & 0 deletions _examples/router-demo/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,32 @@ require (
github.com/asynkron/goconsole v0.0.0-20160504192649-bfa12eebf716
github.com/asynkron/protoactor-go v0.0.0-00010101000000-000000000000
)

require (
github.com/Workiva/go-datastructures v1.1.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/lithammer/shortuuid/v4 v4.0.0 // indirect
github.com/lmittmann/tint v1.0.3 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/orcaman/concurrent-map v1.0.0 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/serialx/hashring v0.0.0-20200727003509-22c0c7ab6b1b // indirect
github.com/twmb/murmur3 v1.1.6 // indirect
go.opentelemetry.io/otel v1.16.0 // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.39.0 // indirect
go.opentelemetry.io/otel/metric v1.16.0 // indirect
go.opentelemetry.io/otel/sdk v1.16.0 // indirect
go.opentelemetry.io/otel/sdk/metric v0.39.0 // indirect
go.opentelemetry.io/otel/trace v1.16.0 // indirect
golang.org/x/sys v0.12.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
)
3 changes: 2 additions & 1 deletion _examples/router-demo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"log"
"log/slog"
"strconv"
"time"

Expand All @@ -23,7 +24,7 @@ func main() {
act := func(context actor.Context) {
switch msg := context.Message().(type) {
case *myMessage:
log.Printf("%v got message %d", context.Self(), msg.i)
context.Logger().Info("got message", slog.Any("self", context.Self()), slog.Any("message", msg))
}
}

Expand Down

0 comments on commit b182f32

Please sign in to comment.