Skip to content

Commit 1b65795

Browse files
authored
Merge pull request #234 from cschleiden/slog-follow-up
Ensure log values have keys in samples
2 parents cda33d4 + 517208a commit 1b65795

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

samples/activity-registration/activity-registration.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ func Workflow1(ctx workflow.Context, msg string) error {
6969
if r1, err := workflow.ExecuteActivity[int](ctx, workflow.DefaultActivityOptions, a.Activity1, 35, 12, nil, "test").Get(ctx); err != nil {
7070
return errors.New("error getting activity 1 result")
7171
} else {
72-
logger.Debug("R1 result:", r1)
72+
logger.Debug("R1 result:", "r1", r1)
7373
}
7474

7575
if r2, err := workflow.ExecuteActivity[int](ctx, workflow.DefaultActivityOptions, a.Activity2).Get(ctx); err != nil {
7676
return errors.New("error getting activity 2 result")
7777
} else {
78-
logger.Debug("R2 result:", r2)
78+
logger.Debug("R2 result:", "r2", r2)
7979
}
8080

8181
return nil

samples/cancellation/cancellation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func Workflow1(ctx workflow.Context, msg string) (string, error) {
121121

122122
func Workflow2(ctx workflow.Context, msg string) (ret string, err error) {
123123
logger := workflow.Logger(ctx)
124-
logger.Debug("Entering Workflow2", msg)
124+
logger.Debug("Entering Workflow2", "msg", msg)
125125
defer logger.Debug("Leaving Workflow2")
126126

127127
defer func() {

samples/complex-parameters/complex-parameters.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ func Workflow1(ctx workflow.Context, args Workflow1Args) error {
7575
if err != nil {
7676
panic("error getting activity 1 result")
7777
}
78-
logger.Debug("R1 result:", r1)
78+
logger.Debug("R1 result:", "r1", r1)
7979

8080
r2, err := workflow.ExecuteActivity[int](ctx, workflow.DefaultActivityOptions, Activity2).Get(ctx)
8181
if err != nil {
8282
panic("error getting activity 1 result")
8383
}
84-
logger.Debug("R2 result:", r2)
84+
logger.Debug("R2 result:", "r2", r2)
8585

8686
return nil
8787
}

samples/concurrent/concurrent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func RunWorker(ctx context.Context, mb backend.Backend) {
6060
func Workflow1(ctx workflow.Context, msg string) (string, error) {
6161
logger := workflow.Logger(ctx)
6262
logger.Debug("Entering Workflow1")
63-
logger.Debug("\tWorkflow instance input:", msg)
63+
logger.Debug("\tWorkflow instance input:", "msg", msg)
6464

6565
defer func() {
6666
logger.Debug("Leaving Workflow1")

samples/signal/signal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func Workflow1(ctx workflow.Context, msg string, subID string) (string, error) {
7575
logger.Debug("Waiting for first signal")
7676
workflow.Select(ctx,
7777
workflow.Receive(workflow.NewSignalChannel[int](ctx, "test"), func(ctx workflow.Context, r int, ok bool) {
78-
logger.Debug("Received signal:", r)
78+
logger.Debug("Received signal:", "r", r)
7979
}),
8080
)
8181

0 commit comments

Comments
 (0)