Added better error messages
This commit is contained in:
parent
33437e1bb1
commit
3592349fd3
4
app.go
4
app.go
|
@ -59,12 +59,12 @@ func (a *App) startup(ctx context.Context) {
|
||||||
func (a *App) initLog() error {
|
func (a *App) initLog() error {
|
||||||
fp, err := config.LogFile()
|
fp, err := config.LogFile()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error getting filepath for log file")
|
return fmt.Errorf("error getting filepath for log file: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
f, err := os.OpenFile(fp, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
|
f, err := os.OpenFile(fp, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error opening log file")
|
return fmt.Errorf("error opening log file: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
a.logInfo = log.New(f, "[info]", log.LstdFlags|log.Lshortfile)
|
a.logInfo = log.New(f, "[info]", log.LstdFlags|log.Lshortfile)
|
||||||
|
|
Loading…
Reference in a new issue