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)
| 21 | // } |
| 22 | // defer f.Close() |
| 23 | func 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. |
searching dependent graphs…