Trevor Pounds 2e8d83266f Update dependencies. (#684)
* Update deps.

* Update to Node.js v10.16.3 LTS.

* Fix mock logutils generation.
2019-09-12 16:02:43 +03:00

34 lines
990 B
Go

package logutils
//go:generate mockgen -source log.go -destination mock_logutils/mock_log.go
//go:generate goimports -w mock_logutils/mock_log.go
type Log interface {
Fatalf(format string, args ...interface{})
Errorf(format string, args ...interface{})
Warnf(format string, args ...interface{})
Infof(format string, args ...interface{})
Child(name string) Log
SetLevel(level LogLevel)
}
type LogLevel int
const (
// debug message, write to debug logs only by logutils.Debug
LogLevelDebug LogLevel = 0
// information messages, don't write too much messages,
// only useful ones: they are shown when running with -v
LogLevelInfo LogLevel = 1
// hidden errors: non critical errors: work can be continued, no need to fail whole program;
// tests will crash if any warning occurred.
LogLevelWarn LogLevel = 2
// only not hidden from user errors: whole program failing, usually
// error logging happens in 1-2 places: in the "main" function.
LogLevelError LogLevel = 3
)