Exemple #1
0
func logger(c *wine.Context) {
	startAt := time.Now()
	c.Next()
	duration := time.Since(startAt)
	timeStr := fmt.Sprintf("%dus", duration/1000)
	gox.LInfo(c.Request.Method, c.Request.RequestURI, timeStr)
}
Exemple #2
0
func (this *server) Run(addr string) error {
	gox.LInfo("Running at", addr, "...")
	this.Print()
	err := http.ListenAndServe(addr, this)
	return err
}