diff --git a/examples/helloworld/main.go b/examples/helloworld/main.go index 6987169..c351cc6 100644 --- a/examples/helloworld/main.go +++ b/examples/helloworld/main.go @@ -2,6 +2,9 @@ package main import ( "fmt" + "github.com/anthdm/hollywood/log" + "log/slog" + "os" "github.com/anthdm/hollywood/actor" ) @@ -28,7 +31,8 @@ func (f *foo) Receive(ctx *actor.Context) { } func main() { - engine := actor.NewEngine() + lh := log.NewHandler(os.Stdout, log.JsonFormat, slog.LevelDebug) + engine := actor.NewEngine(actor.Config{Logger: log.NewLogger("[engine]", lh)}) pid := engine.Spawn(newFoo, "my_actor") for i := 0; i < 100; i++ { engine.Send(pid, &message{data: "hello world!"})