code: func NewHandler(c Config) func(xhandler.HandlerC) xhandler.HandlerC {
  	if c.Output == nil {
  		c.Output = NewOutputChannel(NewConsoleOutput())
  	}
  	return func(next xhandler.HandlerC) xhandler.HandlerC {
  		return xhandler.HandlerFuncC(func(ctx context.Context, w http.ResponseWriter, r *http.Request) {
  			l := New(c)
  			ctx = NewContext(ctx, l)
  			next.ServeHTTPC(ctx, 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.