@@ -439,9 +439,13 @@ func invoke(ctx context.Context, client *http.Client, url, requestID string, bri
439439 return fmt .Errorf ("invalid response from Dispatch API: %v" , err )
440440 }
441441 logger .Debug ("parsed request" , "function" , runRequest .Function , "dispatch_id" , runRequest .DispatchId )
442- switch runRequest .Directive .(type ) {
442+ switch d := runRequest .Directive .(type ) {
443443 case * sdkv1.RunRequest_Input :
444- logger .Info ("calling function" , "function" , runRequest .Function )
444+ if Verbose {
445+ logger .Info ("calling function" , "function" , runRequest .Function , "input" , anyString (d .Input ))
446+ } else {
447+ logger .Info ("calling function" , "function" , runRequest .Function )
448+ }
445449 case * sdkv1.RunRequest_PollResult :
446450 logger .Info ("resuming function" , "function" , runRequest .Function )
447451 }
@@ -497,11 +501,13 @@ func invoke(ctx context.Context, client *http.Client, url, requestID string, bri
497501 case * sdkv1.RunResponse_Exit :
498502 if d .Exit .TailCall != nil {
499503 logger .Info ("function tail-called" , "function" , runRequest .Function , "tail_call" , d .Exit .TailCall .Function )
504+ } else if Verbose && d .Exit .Result != nil {
505+ logger .Info ("function call succeeded" , "function" , runRequest .Function , "output" , anyString (d .Exit .Result .Output ))
500506 } else {
501507 logger .Info ("function call succeeded" , "function" , runRequest .Function )
502508 }
503509 case * sdkv1.RunResponse_Poll :
504- logger .Info ("function yielded" , "function" , runRequest .Function , "calls" , len ( d . Poll . Calls ) )
510+ logger .Info ("function yielded" , "function" , runRequest .Function )
505511 }
506512 default :
507513 err := runResponse .GetExit ().GetResult ().GetError ()
0 commit comments