MCPcopy
hub / github.com/charmbracelet/bubbletea / LogToFile

Function LogToFile

logging.go:23–25  ·  view source on GitHub ↗

LogToFile sets up default logging to log to a file. This is helpful as we can't print to the terminal since our TUI is occupying it. If the file doesn't exist it will be created. Don't forget to close the file when you're done with it. f, err := LogToFile("debug.log", "debug") if err != nil

(path string, prefix string)

Source from the content-addressed store, hash-verified

21// }
22// defer f.Close()
23func LogToFile(path string, prefix string) (*os.File, error) {
24 return LogToFileWith(path, prefix, log.Default())
25}
26
27// LogOptionsSetter is an interface implemented by stdlib's log and charm's log
28// libraries.

Callers 1

TestLogToFileFunction · 0.85

Calls 1

LogToFileWithFunction · 0.85

Tested by 1

TestLogToFileFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…