MCPcopy Index your code
hub / github.com/foxcpp/maddy / Write

Method Write

framework/log/writer.go:34–47  ·  view source on GitHub ↗
(stamp time.Time, debug bool, msg string)

Source from the content-addressed store, hash-verified

32}
33
34func (w wcOutput) Write(stamp time.Time, debug bool, msg string) {
35 builder := strings.Builder{}
36 if w.timestamps {
37 builder.WriteString(stamp.UTC().Format("2006-01-02T15:04:05.000Z "))
38 }
39 if debug {
40 builder.WriteString("[debug] ")
41 }
42 builder.WriteString(msg)
43 builder.WriteRune('\n')
44 if _, err := io.WriteString(w.wc, builder.String()); err != nil {
45 fmt.Fprintf(os.Stderr, "!!! Failed to write message to log: %v\n", err)
46 }
47}
48
49func (w wcOutput) Close() error {
50 return w.wc.Close()

Callers

nothing calls this directly

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected