func (mw *AccessLogApacheMiddleware) MiddlewareFunc(h HandlerFunc) HandlerFunc {

	// set the default Logger
	if mw.Logger == nil {
		mw.Logger = log.New(os.Stderr, "", 0)
	}

	// set default format
	if mw.Format == "" {
		mw.Format = DefaultLogFormat
	}

	mw.convertFormat()

	return func(w ResponseWriter, r *Request) {

		// call the handler
		h(w, r)

		util := &accessLogUtil{w, r}

		mw.Logger.Print(mw.executeTextTemplate(util))
	}
}
func (mw *AccessLogApacheMiddleware) MiddlewareFunc(h HandlerFunc) HandlerFunc {

	
	if mw.Logger == nil {
		mw.Logger = log.New(os.Stderr, "", 0)
	}

	
	if mw.Format == "" {
		mw.Format = DefaultLogFormat
	}

	mw.convertFormat()

	return func(w ResponseWriter, r *Request) {

		
		h(w, r)

		util := &accessLogUtil{w, r}

		mw.Logger.Print(mw.executeTextTemplate(util))
	}
}
func ( mw * AccessLogApacheMiddleware ) MiddlewareFunc ( h HandlerFunc ) HandlerFunc { // set the default Logger if mw . Logger == nil { mw . Logger = log . New ( os . Stderr , " " , 0 ) } // set default format if mw . Format == " " { mw . Format = DefaultLogFormat } mw . convertFormat ( ) return func ( w ResponseWriter , r * Request ) { // call the handler h ( w , r ) util := & accessLogUtil { w , r } mw . Logger . Print ( mw . executeTextTemplate ( util ) ) } }
// MiddlewareFunc makes AccessLogApacheMiddleware implement the Middleware interface.
MiddlewareFunc makes AccessLogApacheMiddleware implement the Middleware interface .