Skip to content

Commit

Permalink
Add structured logging interface (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
sesposito authored Aug 4, 2020
1 parent 2dad577 commit db1dfd6
Showing 1 changed file with 7 additions and 44 deletions.
51 changes: 7 additions & 44 deletions runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,58 +207,21 @@ type Logger interface {
Log a message with optional arguments at ERROR level. Arguments are handled in the manner of fmt.Printf.
*/
Error(format string, v ...interface{})

// *log.Logger compatibility functions below here.

/*
Log a message at info level. Arguments are handled in the manner of fmt.Print. Provided for compatibility with log.Logger.
*/
Print(v ...interface{})
/*
Log a message at info level. Arguments are handled in the manner of fmt.Println. Provided for compatibility with log.Logger.
*/
Println(v ...interface{})
/*
Log a message at info level. Arguments are handled in the manner of fmt.Printf. Provided for compatibility with log.Logger.
*/
Printf(format string, v ...interface{})
/*
Log a message at fatal level and stop the server with a non-0 exit code. Arguments are handled in the manner of fmt.Print.
Provided for compatibility with log.Logger.
*/
Fatal(v ...interface{})
/*
Log a message at fatal level and stop the server with a non-0 exit code. Arguments are handled in the manner of fmt.Println.
Provided for compatibility with log.Logger.
Return a logger with the specified field set so that they are included in subsequent logging calls.
*/
Fatalln(v ...interface{})
WithField(key string, v interface{}) Logger
/*
Log a message at fatal level and stop the server with a non-0 exit code. Arguments are handled in the manner of fmt.Printf.
Provided for compatibility with log.Logger.
Return a logger with the specified fields set so that they are included in subsequent logging calls.
*/
Fatalf(format string, v ...interface{})
WithFields(fields map[string]interface{}) Logger
/*
Log a message at fatal level and panic the server. Arguments are handled in the manner of fmt.Print.
Provided for compatibility with log.Logger.
Returns the fields set in this logger.
*/
Panic(v ...interface{})
/*
Log a message at fatal level and panic the server. Arguments are handled in the manner of fmt.Println.
Fields() map[string]interface{}
}

Provided for compatibility with log.Logger.
*/
Panicln(v ...interface{})
/*
Log a message at fatal level and panic the server. Arguments are handled in the manner of fmt.Printf.

Provided for compatibility with log.Logger.
*/
Panicf(format string, v ...interface{})
}

/*
Initializer is used to register various callback functions with the server.
Expand Down

0 comments on commit db1dfd6

Please sign in to comment.