MCPcopy Create free account
hub / github.com/coder/envbuilder / New

Function New

log/log.go:26–39  ·  view source on GitHub ↗

New logs to the provided io.Writer.

(w io.Writer, verbose bool)

Source from the content-addressed store, hash-verified

24
25// New logs to the provided io.Writer.
26func New(w io.Writer, verbose bool) Func {
27 return func(l Level, msg string, args ...any) {
28 if !verbose {
29 switch l {
30 case LevelDebug, LevelTrace:
31 return
32 }
33 }
34 _, _ = fmt.Fprintf(w, msg, args...)
35 if !strings.HasSuffix(msg, "\n") {
36 _, _ = fmt.Fprintf(w, "\n")
37 }
38 }
39}
40
41// Wrap wraps the provided LogFuncs into a single Func.
42func Wrap(fs ...Func) Func {

Callers 2

Test_VerboseFunction · 0.92
envbuilderCmdFunction · 0.92

Calls

no outgoing calls

Tested by 1

Test_VerboseFunction · 0.74