diff --git a/cli/build.go b/cli/build.go index c78d23082..4e2678f8e 100644 --- a/cli/build.go +++ b/cli/build.go @@ -47,13 +47,13 @@ var buildCmd = &cobra.Command{ } log.InfoStatusEvent(os.Stdout, "YoMo Stream Function parse done.") // build - log.PendingStatusEvent(os.Stdout, "YoMo Stream Function building...") + log.PendingStatusEvent(os.Stdout, "Building YoMo Stream Function instance...") if err := s.Build(true); err != nil { log.FailureStatusEvent(os.Stdout, err.Error()) os.Exit(127) // return } - log.SuccessStatusEvent(os.Stdout, "Success! YoMo Stream Function build.") + log.SuccessStatusEvent(os.Stdout, "YoMo Stream Function build successful!") }, } diff --git a/cli/dev.go b/cli/dev.go index b8a72e8af..6bbfaf2f4 100644 --- a/cli/dev.go +++ b/cli/dev.go @@ -40,7 +40,7 @@ var devCmd = &cobra.Command{ // Serverless log.InfoStatusEvent(os.Stdout, "YoMo Stream Function file: %v", opts.Filename) // resolve serverless - log.PendingStatusEvent(os.Stdout, "Create YoMo Stream Function instance...") + log.PendingStatusEvent(os.Stdout, "Creating YoMo Stream Function instance...") // Connect the serverless to YoMo dev-server, it will automatically emit the mock data. opts.Name = "yomo-app-demo" @@ -66,17 +66,17 @@ var devCmd = &cobra.Command{ } // build if it's go file if ext := filepath.Ext(opts.Filename); ext == ".go" { - log.PendingStatusEvent(os.Stdout, "YoMo Stream Function building...") + log.PendingStatusEvent(os.Stdout, "Building YoMo Stream Function instance...") if err := s.Build(true); err != nil { log.FailureStatusEvent(os.Stdout, err.Error()) os.Exit(127) } - log.SuccessStatusEvent(os.Stdout, "Success! YoMo Stream Function build.") + log.SuccessStatusEvent(os.Stdout, "YoMo Stream Function build successful!") } // run log.InfoStatusEvent( os.Stdout, - "Starting YoMo Stream Function instance with zipper: %v", + "Starting YoMo Stream Function instance, connecting to zipper: %v", opts.ZipperAddr, ) log.InfoStatusEvent(os.Stdout, "Stream Function is running...") diff --git a/cli/run.go b/cli/run.go index 98841fd69..032862787 100644 --- a/cli/run.go +++ b/cli/run.go @@ -49,7 +49,7 @@ var runCmd = &cobra.Command{ return } // resolve serverless - log.PendingStatusEvent(os.Stdout, "Create YoMo Stream Function instance...") + log.PendingStatusEvent(os.Stdout, "Creating YoMo Stream Function instance...") if err := parseZipperAddr(&opts); err != nil { log.FailureStatusEvent(os.Stdout, err.Error()) return @@ -70,12 +70,12 @@ var runCmd = &cobra.Command{ } // build if it's go file if ext := filepath.Ext(opts.Filename); ext == ".go" { - log.PendingStatusEvent(os.Stdout, "YoMo Stream Function building...") + log.PendingStatusEvent(os.Stdout, "Building YoMo Stream Function instance...") if err := s.Build(true); err != nil { log.FailureStatusEvent(os.Stdout, err.Error()) os.Exit(127) } - log.SuccessStatusEvent(os.Stdout, "Success! YoMo Stream Function build.") + log.SuccessStatusEvent(os.Stdout, "YoMo Stream Function build successful!") } // run // wasi @@ -88,7 +88,7 @@ var runCmd = &cobra.Command{ } log.InfoStatusEvent( os.Stdout, - "Starting YoMo Stream Function instance with zipper: %v", + "Starting YoMo Stream Function instance, connecting to zipper: %v", opts.ZipperAddr, ) log.InfoStatusEvent(os.Stdout, "Stream Function is running...") diff --git a/core/client.go b/core/client.go index 5f63781e4..e8f5cb5e0 100644 --- a/core/client.go +++ b/core/client.go @@ -19,6 +19,7 @@ import ( "github.com/yomorun/yomo/pkg/frame-codec/y3codec" "github.com/yomorun/yomo/pkg/id" yquic "github.com/yomorun/yomo/pkg/listener/quic" + "github.com/yomorun/yomo/pkg/log" ) // Client is the abstraction of a YoMo-Client. a YoMo-Client can be @@ -254,6 +255,7 @@ func (c *Client) handshakeWithDefinition(hf *frame.HandshakeFrame) error { if functionDefinition == nil { return nil } + log.InfoStatusEvent(os.Stdout, "Function Calling jsonschema: %s", string(functionDefinition)) hf.FunctionDefinition = functionDefinition return nil } diff --git a/pkg/log/log.go b/pkg/log/log.go index be6ae545c..0dd4f9d34 100644 --- a/pkg/log/log.go +++ b/pkg/log/log.go @@ -74,7 +74,7 @@ func WarningStatusEvent(w io.Writer, fmtstr string, a ...interface{}) { } else if runtime.GOOS == windowsOS { fmt.Fprintf(w, "%s\n", fmt.Sprintf(fmtstr, a...)) } else { - fmt.Fprintf(w, "⚠️⚠ %s\n", fmt.Sprintf(fmtstr, a...)) + fmt.Fprintf(w, "⚠️ %s\n", fmt.Sprintf(fmtstr, a...)) } } @@ -96,7 +96,7 @@ func InfoStatusEvent(w io.Writer, fmtstr string, a ...interface{}) { } else if runtime.GOOS == windowsOS { fmt.Fprintf(w, "%s\n", fmt.Sprintf(fmtstr, a...)) } else { - fmt.Fprintf(w, "ℹ️ %s\n", fmt.Sprintf(fmtstr, a...)) + fmt.Fprintf(w, "ℹ️ %s\n", fmt.Sprintf(fmtstr, a...)) } }