We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3823c2 commit f699fdcCopy full SHA for f699fdc
pkg/client/run.go
@@ -65,6 +65,7 @@ package client
65
import (
66
"errors"
67
"fmt"
68
+ "io"
69
"os"
70
"path/filepath"
71
@@ -88,6 +89,16 @@ type RunOptions struct {
88
89
90
type RunOption func(*RunOptions) error
91
92
+func WithLogger(l io.Writer) RunOption {
93
+ return func(ro *RunOptions) error {
94
+ if ro.Option == nil {
95
+ ro.Option = kcl.NewOption()
96
+ }
97
+ ro.Merge(kcl.WithLogger(l))
98
+ return nil
99
100
+}
101
+
102
// WithWorkDir sets the work directory for running the kcl package.
103
func WithWorkDir(workDir string) RunOption {
104
return func(ro *RunOptions) error {
0 commit comments