dynamo-browse/internal/common/ui/logging/debug.go
Leon Mika 0b745a6dfa ssm-browse: new utility to browse SSM parameters
This is more of an exercise to work out how best to use controllers
2022-03-29 08:41:27 +11:00

19 lines
267 B
Go

package logging
import (
"fmt"
tea "github.com/charmbracelet/bubbletea"
"os"
)
func EnableLogging() (closeFn func()) {
f, err := tea.LogToFile("debug.log", "debug")
if err != nil {
fmt.Println("fatal:", err)
os.Exit(1)
}
return func() {
f.Close()
}
}