mercury/main.go

36 lines
849 B
Go
Raw Normal View History

2023-09-03 00:23:48 +02:00
// Package main is the entrypoint to Mercury.
package main
import (
"os"
"git.sleepycat.moe/sam/mercury/cmd/migrate"
"git.sleepycat.moe/sam/mercury/cmd/seed"
"git.sleepycat.moe/sam/mercury/cmd/web"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/urfave/cli/v2"
)
var app = &cli.App{
Name: "mercury",
HelpName: "Mercury server",
Usage: "Multi-blog ActivityPub server",
Commands: []*cli.Command{
web.Command,
migrate.Command,
seed.Command,
},
}
func main() {
// set the logger to output to console format
// while performance is nice, the logger is not the place we'll ever get bottlenecked
// and the console output is friendlier
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr, TimeFormat: "[15:04:05]"})
if err := app.Run(os.Args); err != nil {
log.Err(err).Msg("running app")
}
}