write fathom version to log whenever fathom boots

This commit is contained in:
Danny 2018-05-25 14:29:07 +02:00
parent 3f97ad2557
commit 116cd3cd0f
3 changed files with 6 additions and 5 deletions

View File

@ -73,6 +73,7 @@ func main() {
},
}
log.Infof("%s %s", app.Name, app.Version)
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)

View File

@ -13,12 +13,12 @@ import (
func register(c *cli.Context) error {
email := c.String("email")
if email == "" {
return errors.New("invalid args: missing email address")
return errors.New("Invalid arguments: missing email address")
}
password := c.String("password")
if password == "" {
return errors.New("invalid args: missing password")
return errors.New("Invalid arguments: missing password")
}
hash, _ := bcrypt.GenerateFromPassword([]byte(password), 10)
@ -29,9 +29,9 @@ func register(c *cli.Context) error {
err := app.database.SaveUser(user)
if err != nil {
return fmt.Errorf("error creating user: %s", err)
return fmt.Errorf("Error creating user: %s", err)
}
log.Infof("created user %s", user.Email)
log.Infof("Created user %s", user.Email)
return nil
}

View File

@ -31,7 +31,7 @@ func server(c *cli.Context) error {
}
// start listening
log.Printf("Fathom is now listening on %s", addr)
log.Printf("Server is now listening on %s", addr)
err := http.ListenAndServe(addr, h)
if err != nil {
log.Errorln(err)