From ff5b4639d597203f8aec43e5eae8fe3774976d32 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Thu, 16 May 2019 11:46:17 -0600 Subject: Some minor updates, and get rid of OnLoad/OnUnload --- modules/caddyhttp/caddylog/log.go | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'modules/caddyhttp/caddylog/log.go') diff --git a/modules/caddyhttp/caddylog/log.go b/modules/caddyhttp/caddylog/log.go index dfc9da5..d3110cc 100644 --- a/modules/caddyhttp/caddylog/log.go +++ b/modules/caddyhttp/caddylog/log.go @@ -13,24 +13,6 @@ func init() { caddy2.RegisterModule(caddy2.Module{ Name: "http.middleware.log", New: func() (interface{}, error) { return new(Log), nil }, - // TODO: Examples of OnLoad and OnUnload. - OnLoad: func(instances []interface{}, priorState interface{}) (interface{}, error) { - var counter int - if priorState != nil { - counter = priorState.(int) - } - counter++ - for _, inst := range instances { - logInst := inst.(*Log) - logInst.counter = counter - } - log.Println("State is now:", counter) - return counter, nil - }, - OnUnload: func(state interface{}) error { - log.Println("Closing log files, state:", state) - return nil - }, }) } -- cgit v1.2.3