Commit 4f3a3660 authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Expose caller information in log messages.

parent f94236cb
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -15,7 +15,8 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
- New Lua runtime function to print a log message at debug level.
- Lua runtime accounts get operations now return Facebook Instant Game IDs.
- Runtime account get operations now return account disable time if available.
- Last user relationship update time is exposed when listing friends.
- Expose last user relationship update time when listing friends.
- Expose caller information in log messages.

### Changed
- Replace metrics implementation.
+3 −3
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ func NewRotatingJSONFileLogger(consoleLogger *zap.Logger, config Config, level z
		Compress:   config.GetLogger().Compress,
	})
	core := zapcore.NewCore(jsonEncoder, writeSyncer, level)
	options := []zap.Option{zap.AddStacktrace(zap.ErrorLevel)}
	options := []zap.Option{zap.AddCaller()}
	return zap.New(core, options...)
}

@@ -136,7 +136,7 @@ func NewMultiLogger(loggers ...*zap.Logger) *zap.Logger {
	}

	teeCore := zapcore.NewTee(cores...)
	options := []zap.Option{zap.AddStacktrace(zap.ErrorLevel)}
	options := []zap.Option{zap.AddCaller()}
	return zap.New(teeCore, options...)
}

@@ -144,7 +144,7 @@ func NewJSONLogger(output *os.File, level zapcore.Level, format LoggingFormat) *
	jsonEncoder := newJSONEncoder(format)

	core := zapcore.NewCore(jsonEncoder, zapcore.Lock(output), level)
	options := []zap.Option{zap.AddStacktrace(zap.ErrorLevel)}
	options := []zap.Option{zap.AddCaller()}
	return zap.New(core, options...)
}