2018-01-25 19:21:55 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2018-01-26 00:08:26 +00:00
|
|
|
"github.com/vulcanize/vulcanizedb/cmd"
|
2018-11-21 04:47:01 +00:00
|
|
|
"os"
|
2019-07-11 23:57:37 +00:00
|
|
|
|
2019-09-11 03:37:12 +00:00
|
|
|
"github.com/sirupsen/logrus"
|
2018-01-25 19:21:55 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2019-09-11 03:37:12 +00:00
|
|
|
logrus.SetFormatter(&logrus.JSONFormatter{
|
2019-07-18 07:21:40 +00:00
|
|
|
PrettyPrint: true,
|
|
|
|
})
|
2019-03-05 10:30:22 +00:00
|
|
|
file, err := os.OpenFile("vulcanizedb.log",
|
|
|
|
os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
|
2018-11-21 04:47:01 +00:00
|
|
|
if err == nil {
|
2019-09-11 03:37:12 +00:00
|
|
|
logrus.SetOutput(file)
|
2018-11-21 04:47:01 +00:00
|
|
|
} else {
|
2019-09-11 03:37:12 +00:00
|
|
|
logrus.Info("Failed to log to file, using default stderr")
|
2018-11-21 04:47:01 +00:00
|
|
|
}
|
|
|
|
|
2018-01-25 19:21:55 +00:00
|
|
|
cmd.Execute()
|
|
|
|
}
|