MCPcopy Index your code
hub / github.com/jetify-com/devbox / logToFile

Method logToFile

internal/boxcli/integrate.go:164–180  ·  view source on GitHub ↗
(msg string)

Source from the content-addressed store, hash-verified

162}
163
164func (d *debugMode) logToFile(msg string) {
165 // only write to file when --debugmode=true flag is passed
166 if d.enabled {
167 file, err := os.OpenFile(".devbox/extension.log", os.O_APPEND|os.O_WRONLY, 0o666)
168 if err != nil {
169 log.Fatal(err)
170 }
171 timestamp := time.Now().UTC().Format(time.RFC1123)
172 _, err = file.WriteString("[" + timestamp + "] " + msg + "\n")
173 if err != nil {
174 log.Fatal(err)
175 }
176 if err = file.Close(); err != nil {
177 log.Fatal(err)
178 }
179 }
180}

Callers 1

runIntegrateVSCodeCmdFunction · 0.95

Calls 1

FormatMethod · 0.45

Tested by

no test coverage detected