Skip to content

Commit

Permalink
Levels as Lvl
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal Rana <[email protected]>
  • Loading branch information
vishr committed Jun 4, 2019
1 parent 4347fba commit ab0bfd9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type (
)

const (
DEBUG uint32 = iota + 1
DEBUG Lvl = iota + 1
INFO
WARN
ERROR
Expand All @@ -59,7 +59,7 @@ func init() {

func New(prefix string) (l *Logger) {
l = &Logger{
level: INFO,
level: uint32(INFO),
skip: 2,
prefix: prefix,
template: l.newTemplate(defaultHeader),
Expand Down Expand Up @@ -348,8 +348,8 @@ func Panicj(j JSON) {
global.Panicj(j)
}

func (l *Logger) log(level uint32, format string, args ...interface{}) {
if level >= l.level || level == 0 {
func (l *Logger) log(level Lvl, format string, args ...interface{}) {
if level >= l.Level() || level == 0 {
buf := l.bufferPool.Get().(*bytes.Buffer)
buf.Reset()
defer l.bufferPool.Put(buf)
Expand Down

0 comments on commit ab0bfd9

Please sign in to comment.