mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-24 08:54:51 +00:00
logging: implement lazy sprinting (#8898)
shout out to @joeabbey for the inspiration. This makes the lazy functions internal by default to prevent potential misuse by external callers. Should backport cleanly into 0.36 and I'll handle a messy merge into 0.35
This commit is contained in:
@@ -58,7 +58,7 @@ func DefaultConfig() *Config {
|
||||
// Serve creates a http.Server and calls Serve with the given listener. It
|
||||
// wraps handler to recover panics and limit the request body size.
|
||||
func Serve(ctx context.Context, listener net.Listener, handler http.Handler, logger log.Logger, config *Config) error {
|
||||
logger.Info(fmt.Sprintf("Starting RPC HTTP server on %s", listener.Addr()))
|
||||
logger.Info("Starting RPC HTTP server on", "addr", listener.Addr())
|
||||
h := recoverAndLogHandler(MaxBytesHandler(handler, config.MaxBodyBytes), logger)
|
||||
s := &http.Server{
|
||||
Handler: h,
|
||||
|
||||
Reference in New Issue
Block a user