MCPcopy
hub / github.com/tailscale/tailscale / appendToFileLocked

Method appendToFileLocked

log/filelogger/log.go:102–114  ·  view source on GitHub ↗

out should end in a newline. w.mu must be held.

(out []byte)

Source from the content-addressed store, hash-verified

100// out should end in a newline.
101// w.mu must be held.
102func (w *logFileWriter) appendToFileLocked(out []byte) {
103 now := time.Now()
104 day := dayOf(now)
105 if w.fday != day {
106 w.startNewFileLocked()
107 }
108 out = removeDatePrefix(out)
109 if w.f != nil {
110 fmt.Fprintf(w.f, "%s: %s",
111 now.Format(tstime.DateTTimeMilliZ),
112 out)
113 }
114}
115
116func isNum(b byte) bool { return '0' <= b && b <= '9' }
117

Callers 1

LogfMethod · 0.95

Calls 5

startNewFileLockedMethod · 0.95
dayOfFunction · 0.85
removeDatePrefixFunction · 0.85
NowMethod · 0.65
FormatMethod · 0.45

Tested by

no test coverage detected