flag for journallog
This commit is contained in:
25
main.go
25
main.go
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/gorilla/mux"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/wercker/journalhook"
|
||||
"go.uber.org/ratelimit"
|
||||
"gopkg.in/yaml.v3"
|
||||
"net"
|
||||
@@ -28,16 +29,17 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
conf = utils.Conf{}
|
||||
demoLoader = &csgo.DemoMatchLoader{}
|
||||
router *mux.Router
|
||||
db *utils.DBWithLock
|
||||
sendGC chan *csgo.Demo
|
||||
demoParser = &csgo.DemoParser{}
|
||||
firstHK = true
|
||||
rL ratelimit.Limiter
|
||||
configFlag = flag.String("config", "config.yaml", "Set config to use")
|
||||
authCodeFlag = flag.String("authcode", "", "Provide Steam AuthCode to login")
|
||||
conf = utils.Conf{}
|
||||
demoLoader = &csgo.DemoMatchLoader{}
|
||||
router *mux.Router
|
||||
db *utils.DBWithLock
|
||||
sendGC chan *csgo.Demo
|
||||
demoParser = &csgo.DemoParser{}
|
||||
firstHK = true
|
||||
rL ratelimit.Limiter
|
||||
configFlag = flag.String("config", "config.yaml", "Set config to use")
|
||||
authCodeFlag = flag.String("authcode", "", "Provide Steam AuthCode to login")
|
||||
journalLogFlag = flag.Bool("journal", false, "Log to systemd journal instead of stdout")
|
||||
)
|
||||
|
||||
type PlayerResponse struct {
|
||||
@@ -371,6 +373,9 @@ func main() {
|
||||
lvl, err := log.ParseLevel(conf.Logging.Level)
|
||||
utils.Check(err)
|
||||
log.SetLevel(lvl)
|
||||
if *journalLogFlag {
|
||||
journalhook.Enable()
|
||||
}
|
||||
|
||||
db = &utils.DBWithLock{
|
||||
Lock: new(sync.RWMutex),
|
||||
|
Reference in New Issue
Block a user