MCPcopy Create free account
hub / github.com/MMadmer/EpicAssetsNotifyBot / configureLogging

Function configureLogging

internal/app/bootstrap.go:64–79  ·  view source on GitHub ↗
(logPath string)

Source from the content-addressed store, hash-verified

62}
63
64func configureLogging(logPath string) error {
65 if logPath == "" {
66 return nil
67 }
68 if err := os.MkdirAll(filepath.Dir(logPath), 0o755); err != nil {
69 return fmt.Errorf("create log directory: %w", err)
70 }
71 file, err := os.OpenFile(logPath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0o644)
72 if err != nil {
73 return fmt.Errorf("open log file: %w", err)
74 }
75
76 log.SetFlags(log.LstdFlags | log.Lmsgprefix)
77 log.SetOutput(io.MultiWriter(os.Stdout, file))
78 return nil
79}
80
81type sqliteAdapter struct {
82 inner *sqlitestore.Store

Callers 1

NewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected