code: func NewHandler(c Config) func(http.Handler) http.Handler {
  	if c.Output == nil {
  		c.Output = NewOutputChannel(NewConsoleOutput())
  	}
  	return func(next http.Handler) http.Handler {
  		return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
  			var l Logger
  			if r != nil {
  				l = New(c)
  				r = r.WithContext(NewContext(r.Context(), l))
  			}
  			next.ServeHTTP(w, r)
  			if l, ok := l.(*logger); ok {
  				l.close()
  			}
  		})
  	}
  }
docs: // NewHandler instanciates a new xlog HTTP handler.
  //
  // If not configured, the output is set to NewConsoleOutput() by default.