code: func NewOutputChannelBuffer(o Output, bufSize int) *OutputChannel {
  	oc := &OutputChannel{
  		input:  make(chan map[string]interface{}, bufSize),
  		output: o,
  		stop:   make(chan struct{}),
  	}
  
  	go func() {
  		for {
  			select {
  			case msg := <-oc.input:
  				if err := o.Write(msg); err != nil {
  					critialLogger.Print("cannot write log message: ", err.Error())
  				}
  			case <-oc.stop:
  				close(oc.stop)
  				return
  			}
  		}
  	}()
  
  	return oc
  }
docs: // NewOutputChannelBuffer creates a consumer buffered channel for the given output
  // with a customizable buffer size.