push
github
63 of 372 new or added lines in 13 files covered. (16.94%)
33 existing lines in 7 files now uncovered.189 of 1865 relevant lines covered (10.13%)
3.95 hits per line
1 |
package main
|
|
2 |
|
|
3 |
import (
|
|
4 |
"os"
|
|
5 |
|
|
6 |
"github.com/adrg/xdg"
|
|
7 |
"github.com/charmbracelet/log"
|
|
8 |
) |
|
9 |
|
|
NEW
|
func getLogFilePath() (string, error) { |
× |
NEW
|
return xdg.CacheFile("glow/glow.log") |
× |
NEW
|
} |
× |
13 |
|
|
NEW
|
func setupLog() (func() error, error) { |
× |
NEW
|
// Log to file, if set
|
× |
NEW
|
logFile, err := getLogFilePath() |
× |
NEW
|
if err != nil { |
× |
NEW
|
return nil, err |
× |
NEW
|
} |
× |
NEW
|
f, err := os.OpenFile(logFile, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o644)
|
× |
NEW
|
if err != nil { |
× |
NEW
|
return nil, err |
× |
NEW
|
} |
× |
NEW
|
log.SetOutput(f) |
× |
NEW
|
log.SetLevel(log.DebugLevel) |
× |
NEW
|
return f.Close, nil |
× |
27 |
} |