Remove verbose logging, it's no-op with Fiber

Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

git-svn-id: file:///srv/svn/repo/mai/trunk@65 e410bdd4-646f-c54f-a7ce-fffcc4f439ae
This commit is contained in:
yakumo.izuru 2024-01-21 13:03:02 +00:00
parent ed41833994
commit 119cdd14d4
3 changed files with 2 additions and 15 deletions

View File

@ -7,6 +7,5 @@ import (
func parseFlags() { func parseFlags() {
flag.StringVar(&configfile, "f", "", "Configuration file") flag.StringVar(&configfile, "f", "", "Configuration file")
flag.BoolVar(&verbose, "v", false, "Verbose logging")
flag.Parse() flag.Parse()
} }

View File

@ -20,7 +20,6 @@ import (
) )
var ( var (
configfile string configfile string
verbose bool
) )
var conf struct { var conf struct {
group string group string
@ -33,9 +32,6 @@ func main() {
parseFlags() parseFlags()
if configfile != "" { if configfile != "" {
if verbose {
fmt.Printf("[mai] Reading configuration file")
}
readConf(configfile) readConf(configfile)
} }
@ -45,9 +41,6 @@ func main() {
conf.tmplpath = "./views" conf.tmplpath = "./views"
if conf.user != "" { if conf.user != "" {
if verbose {
fmt.Printf("[mai] Dropping privileges to %s", conf.user)
}
uid, gid, err := usergroupids(conf.user, conf.group) uid, gid, err := usergroupids(conf.user, conf.group)
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
@ -63,7 +56,7 @@ func main() {
app := fiber.New( app := fiber.New(
fiber.Config{ fiber.Config{
AppName: "Mai", AppName: "Mai",
DisableStartupMessage: true, ServerHeader: "Mai (using Fiber v2.x)",
Views: engine, Views: engine,
}) })
@ -262,6 +255,7 @@ func main() {
return c.JSON(fiber.Map{ return c.JSON(fiber.Map{
"fiberversion": fiber.Version, "fiberversion": fiber.Version,
"goversion": runtime.Version(), "goversion": runtime.Version(),
"maiversion": mai.FullVersion(),
}) })
}) })
app.Post("/switchlanguages", func(c *fiber.Ctx) error { app.Post("/switchlanguages", func(c *fiber.Ctx) error {
@ -287,9 +281,4 @@ func main() {
Browse: true, Browse: true,
}) })
app.Listen(conf.listen) app.Listen(conf.listen)
if verbose {
fmt.Printf("Starting mai %v\n", mai.FullVersion())
fmt.Printf("Listening on %s", conf.listen)
}
} }

1
mai.1
View File

@ -7,7 +7,6 @@
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm .Nm
.Op Fl f Ar config-file .Op Fl f Ar config-file
.Op Fl v
.Sh DESCRIPTION .Sh DESCRIPTION
This project has been forked from the remains of the This project has been forked from the remains of the
rewrite of the SimplyTranslate project, which is currently rewrite of the SimplyTranslate project, which is currently