Skip to content

Instantly share code, notes, and snippets.

@intabulas
Created March 12, 2014 16:41
Show Gist options
  • Save intabulas/9510965 to your computer and use it in GitHub Desktop.
Save intabulas/9510965 to your computer and use it in GitHub Desktop.
Timestamped Logging with Martini - Until I make a PR
// version of Martini classic, butthe logs are timestamped
func Vesper() *martini.ClassicMartini {
r := martini.NewRouter()
m := martini.New()
m.Map(log.New(os.Stdout, "[martini] ", log.LstdFlags))
m.Use(martini.Logger())
m.Use(martini.Recovery())
m.Use(martini.Static("public"))
m.MapTo(r, (*martini.Routes)(nil))
m.Action(r.Handle)
return &martini.ClassicMartini{m, r}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment