mirror of
https://github.com/googleforgames/open-match.git
synced 2025-03-25 13:24:18 +00:00
Add stackdriver format support via TV4/logrus-stackdriver-formatter. Simply set format in config to stackdriver
This commit is contained in:
committed by
Joseph Holley
parent
b0b7b4bd15
commit
58ff12f3f8
@ -1,6 +1,7 @@
|
||||
package logging
|
||||
|
||||
import (
|
||||
stackdriver "github.com/TV4/logrus-stackdriver-formatter"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
@ -11,6 +12,8 @@ import (
|
||||
// - include source file and line number for every event (false [default], true)
|
||||
func ConfigureLogging(cfg *viper.Viper) {
|
||||
switch cfg.GetString("logging.format") {
|
||||
case "stackdriver":
|
||||
logrus.SetFormatter(stackdriver.NewFormatter())
|
||||
case "json":
|
||||
logrus.SetFormatter(&logrus.JSONFormatter{})
|
||||
case "text":
|
||||
|
Reference in New Issue
Block a user