Documentation
¶
Overview ¶
Flogger provides a simple wrapper around go's base logging library to provide logging levels. Further documentation can be found at https://github.com/zdannar/flogger
Index ¶
- Constants
- Variables
- func Close() error
- func Debug(args ...interface{})
- func Debugf(msg string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(msg string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(msg string, args ...interface{})
- func Info(args ...interface{})
- func Infof(msg string, args ...interface{})
- func OpenFile(logPath string, openMode int, perms os.FileMode) error
- func Panic(args ...interface{})
- func Panicf(msg string, args ...interface{})
- func RedirectStreams() error
- func SetLevel(level int)
- func SetLevelMap(lmap map[int]string)
- func Warning(args ...interface{})
- func Warningf(msg string, args ...interface{})
- type Flogger
- func (f *Flogger) Close() error
- func (f *Flogger) Debug(args ...interface{})
- func (f *Flogger) Debugf(msg string, args ...interface{})
- func (f *Flogger) Error(args ...interface{})
- func (f *Flogger) Errorf(msg string, args ...interface{})
- func (f *Flogger) Fatal(args ...interface{})
- func (f *Flogger) Fatalf(msg string, args ...interface{})
- func (f *Flogger) Info(args ...interface{})
- func (f *Flogger) Infof(msg string, args ...interface{})
- func (f *Flogger) OpenFile(logPath string, openMode int, perms os.FileMode) error
- func (f *Flogger) Panic(args ...interface{})
- func (f *Flogger) Panicf(msg string, args ...interface{})
- func (f *Flogger) RedirectStream(fd int) error
- func (f *Flogger) RedirectStreams() error
- func (f *Flogger) SetLevel(level int)
- func (f *Flogger) SetLevelMap(lmap map[int]string)
- func (f *Flogger) Warning(args ...interface{})
- func (f *Flogger) Warningf(msg string, args ...interface{})
Constants ¶
const ( DEBUG int = iota INFO WARNING ERROR FATAL PANIC )
const ( STDOUT = iota + 1 STDERR )
Variables ¶
Functions ¶
func RedirectStreams ¶
func RedirectStreams() error
Calls f.RedirectStreams() on base logging object.
Types ¶
type Flogger ¶
type Flogger struct {
// contains filtered or unexported fields
}
Flogger structure.
func (*Flogger) Close ¶
Flushes and closes file descriptor that flogger is logging to. Should always be called at the end of execution.
func (*Flogger) Debug ¶
func (f *Flogger) Debug(args ...interface{})
Logs to the debugging logging channel
func (*Flogger) Error ¶
func (f *Flogger) Error(args ...interface{})
Logs to the error logging channel
func (*Flogger) Fatal ¶
func (f *Flogger) Fatal(args ...interface{})
Logs your message, then calls os.Exit(1).
func (*Flogger) RedirectStream ¶
Redirects file descriptor to log file. Example: flogger.RedirectStream(flogger.STDERR)
func (*Flogger) RedirectStreams ¶
Redirects stdout and stderr to log file. Very handy to catch the output of panics in your log file.
func (*Flogger) SetLevel ¶
Sets the logger level. Usually called with flogger.INFO, flogger.DEBUG, etc...
func (*Flogger) SetLevelMap ¶
Sets logging level map. Provides the abilty to change level messages. Default logger uses flogger.FLOG_LEVELS