mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 02:17:05 +00:00
update golog dependency
This commit is contained in:
@@ -10,7 +10,9 @@ import (
|
||||
func main() {
|
||||
app := iris.New()
|
||||
app.Logger().SetLevel("debug")
|
||||
app.Logger().Handle(golog.JSON(" ")) /* see below to manually create a handler */
|
||||
app.Logger().SetFormat("json", " ")
|
||||
// to register a custom Formatter:
|
||||
// app.Logger().RegisterFormatter(golog.Formatter...)
|
||||
|
||||
// Also, see app.Logger().SetLevelOutput(level string, w io.Writer)
|
||||
// to set a custom writer for a specific level.
|
||||
@@ -79,15 +81,3 @@ func ping(ctx iris.Context) {
|
||||
|
||||
ctx.WriteString("pong")
|
||||
}
|
||||
|
||||
/* Manually. Use it for any custom format:
|
||||
func jsonOutput(l *golog.Log) bool {
|
||||
// you can change the output to a file as well.
|
||||
enc := json.NewEncoder(l.Logger.GetLevelOutput(l.Level.String()))
|
||||
enc.SetIndent("", " ")
|
||||
err := enc.Encode(l)
|
||||
return err == nil
|
||||
}
|
||||
|
||||
app.Logger().Handle(jsonOutput)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user