Documentation ¶
Overview ¶
Copyright (C) 2016-2017 dapperdox.com
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- Variables
- func Debugf(req *http.Request, format string, args ...interface{})
- func Debugln(req *http.Request, message ...interface{})
- func Errorf(req *http.Request, format string, args ...interface{})
- func Errorln(req *http.Request, message ...interface{})
- func Handler(h http.Handler) http.Handler
- func Infof(req *http.Request, format string, args ...interface{})
- func Infoln(req *http.Request, message ...interface{})
- func Levelf(req *http.Request, level Level, format string, args ...interface{})
- func Levelln(req *http.Request, level Level, message ...interface{})
- func Printf(req *http.Request, format string, args ...interface{})
- func Println(req *http.Request, message ...interface{})
- func Tracef(req *http.Request, format string, args ...interface{})
- func Traceln(req *http.Request, message ...interface{})
- func Warnf(req *http.Request, format string, args ...interface{})
- func Warnln(req *http.Request, message ...interface{})
- type Level
Constants ¶
const ( // Error is the error level Error = Level(iota) // Warn is the warn level Warn // Info is the info level Info // Debug is the debug level Debug // Trace is the trace level Trace )
Variables ¶
var ( // Logf is the function called for *f functions Logf = log.Printf // Logln is the function called for *ln functions Logln = log.Println )
var DefaultLevel = func() Level { if v := strings.ToLower(os.Getenv("LOGLEVEL")); len(v) > 0 { for i, j := range LevelString { if j == v { return i } } log.Fatalf("invalid log level in environment variable LOGLEVEL, expected error|warn|info|debug|trace, got '%s'", v) } return Info }()
DefaultLevel is the default log level
var LevelString = map[Level]string{ Error: "error", Warn: "warn", Info: "info", Debug: "debug", Trace: "trace", }
LevelString is a level to string lookup map