Skip to content

Commit

Permalink
Merge pull request #937 from asynkron/use-slog
Browse files Browse the repository at this point in the history
WiP: Start using slog
  • Loading branch information
rogeralsing authored Nov 21, 2023
2 parents 4a1786d + b289ac3 commit 493e330
Show file tree
Hide file tree
Showing 155 changed files with 2,384 additions and 2,774 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go_version: ['1.19']
go_version: ['1.21']
# services:
# redis:
# image: redis:5.0-alpine
Expand Down
28 changes: 28 additions & 0 deletions _examples/actor-autorespond/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,31 @@ go 1.21
replace github.com/asynkron/protoactor-go => ../..

require 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/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
)
28 changes: 28 additions & 0 deletions _examples/actor-backpressure/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,31 @@ 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/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
)
28 changes: 28 additions & 0 deletions _examples/actor-deadletter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,31 @@ require (
github.com/asynkron/protoactor-go v0.0.0-00010101000000-000000000000
golang.org/x/time v0.1.0
)

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/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
)
28 changes: 28 additions & 0 deletions _examples/actor-helloworld/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,31 @@ 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/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
)
5 changes: 2 additions & 3 deletions _examples/actor-helloworld/main.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package main

import (
"fmt"

console "github.com/asynkron/goconsole"
"github.com/asynkron/protoactor-go/actor"
"log/slog"
)

type (
Expand All @@ -15,7 +14,7 @@ type (
func (state *helloActor) Receive(context actor.Context) {
switch msg := context.Message().(type) {
case *hello:
fmt.Printf("Hello %v\n", msg.Who)
context.Logger().Info("Hello ", slog.String("who", msg.Who))
}
}

Expand Down
28 changes: 28 additions & 0 deletions _examples/actor-inprocess-benchmark/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,31 @@ go 1.21
replace github.com/asynkron/protoactor-go => ../..

require 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/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
)
35 changes: 33 additions & 2 deletions _examples/actor-jaegertracing/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,40 @@ go 1.21
replace github.com/asynkron/protoactor-go => ../..

require (
github.com/HdrHistogram/hdrhistogram-go v1.1.0 // indirect
github.com/asynkron/goconsole v0.0.0-20160504192649-bfa12eebf716
github.com/asynkron/protoactor-go v0.0.0-00010101000000-000000000000
github.com/asynkron/protoactor-go v0.0.0-20231118073122-4a1786d70f82
github.com/uber/jaeger-client-go v2.25.0+incompatible
github.com/uber/jaeger-lib v2.4.0+incompatible
)

require (
github.com/HdrHistogram/hdrhistogram-go v1.1.0 // indirect
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/opentracing/opentracing-go v1.2.0 // indirect
github.com/orcaman/concurrent-map v1.0.0 // indirect
github.com/pkg/errors v0.9.1 // 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/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
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/sys v0.12.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
)
96 changes: 0 additions & 96 deletions _examples/actor-jaegertracing/router/main.go

This file was deleted.

30 changes: 29 additions & 1 deletion _examples/actor-lifecycleevents/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,33 @@ replace github.com/asynkron/protoactor-go => ../..

require (
github.com/asynkron/goconsole v0.0.0-20160504192649-bfa12eebf716
github.com/asynkron/protoactor-go v0.0.0-00010101000000-000000000000
github.com/asynkron/protoactor-go v0.0.0-20231118073122-4a1786d70f82
)

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/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
)
12 changes: 6 additions & 6 deletions _examples/actor-lifecycleevents/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"fmt"
"log/slog"
"time"

console "github.com/asynkron/goconsole"
Expand All @@ -16,15 +16,15 @@ type (
func (state *helloActor) Receive(context actor.Context) {
switch msg := context.Message().(type) {
case *actor.Started:
fmt.Println("Started, initialize actor here")
context.Logger().Info("Started, initialize actor here")
case *actor.Stopping:
fmt.Println("Stopping, actor is about shut down")
context.Logger().Info("Stopping, actor is about shut down")
case *actor.Stopped:
fmt.Println("Stopped, actor and its children are stopped")
context.Logger().Info("Stopped, actor and its children are stopped")
case *actor.Restarting:
fmt.Println("Restarting, actor is about restart")
context.Logger().Info("Restarting, actor is about restart")
case *hello:
fmt.Printf("Hello %v\n", msg.Who)
context.Logger().Info("Hello", slog.String("Who", msg.Who))
}
}

Expand Down
Loading

0 comments on commit 493e330

Please sign in to comment.