-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
43 lines (35 loc) · 878 Bytes
/
main.go
File metadata and controls
43 lines (35 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
import (
"flag"
"runtime"
"github.com/Primexz/lndnotify/internal/app"
log "github.com/sirupsen/logrus"
prefixed "github.com/x-cray/logrus-prefixed-formatter"
)
var (
version = "dev"
commit = "none"
date = "unknown"
)
func main() {
versionFlag := flag.Bool("version", false, "Print version and Go version")
configPath := flag.String("config", "config.yaml", "Path to configuration file")
flag.Parse()
log.SetFormatter(&prefixed.TextFormatter{
TimestampFormat: "2006/01/02 - 15:04:05",
FullTimestamp: true,
QuoteEmptyFields: true,
SpacePadding: 45,
})
log.SetReportCaller(true)
log.WithFields(log.Fields{
"commit": commit,
"runtime": runtime.Version(),
"arch": runtime.GOARCH,
"build_date": date,
}).Infof("⚡️ lndnotify %s", version)
if *versionFlag {
return
}
app.Run(*configPath, version)
}