diff --git a/go.mod b/go.mod index 0153ac7..b48c409 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module github.com/z26100/log-go -go 1.15 +go 1.22 diff --git a/log.go b/log.go index e05e73e..036b3cc 100644 --- a/log.go +++ b/log.go @@ -2,13 +2,12 @@ package log import ( "log" - "net/http" ) -type LogLevelType int +type LevelType int const ( - TRACE LogLevelType = iota + TRACE LevelType = iota DEBUG INFO WARN @@ -20,7 +19,7 @@ var ( LogLevel = INFO ) -func (l LogLevelType) String() string { +func (l LevelType) String() string { switch l { case TRACE: return "TRACE" @@ -117,9 +116,3 @@ func Error(args ...interface{}) { func Fatal(err error) { log.Fatal(err) } -func Handler(handler http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - Debugln("http request", r.Method, r.URL) - handler.ServeHTTP(w, r) - }) -}