diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2019-05-16 11:46:17 -0600 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2019-05-16 11:46:17 -0600 |
commit | ff5b4639d597203f8aec43e5eae8fe3774976d32 (patch) | |
tree | fa7f9d24494f61232c87efd6b68ee7f8909ffb00 /modules/caddyhttp/caddylog | |
parent | f9d93ead4ef6e099ba7e00318dce6509b0f1eda4 (diff) |
Some minor updates, and get rid of OnLoad/OnUnload
Diffstat (limited to 'modules/caddyhttp/caddylog')
-rw-r--r-- | modules/caddyhttp/caddylog/log.go | 18 |
1 files changed, 0 insertions, 18 deletions
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 - }, }) } |