Пример #1
0
func main() {
	runtime.GOMAXPROCS(runtime.NumCPU())
	logger := log.New(os.Stdout, "[tango] ", log.Ldefault())
	t := tango.Classic(logger)
	t.Use(tpongo2.New())
	t.Get("/json", new(JsonAction))
	t.Get("/pongo", new(PongoAction))
	t.Get("/string", new(StringAction))
	t.Run(":8001")
}
Пример #2
0
func NewLogger(out io.Writer) Logger {
	l := log.New(out, "[tango] ", log.Ldefault())
	l.SetOutputLevel(log.Ldebug)
	return l
}