Skip to content

Commit

Permalink
add level type function
Browse files Browse the repository at this point in the history
  • Loading branch information
mobus committed Mar 9, 2022
1 parent 6e710c7 commit 7d31147
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions examples/log/log_ex.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
package main

import "github.com/sunvim/utils/log"
import (
"fmt"

"github.com/sunvim/utils/log"
)

func main() {
log.SetPrefix("Hello")
log.SetPrefix("Example")

fmt.Println("debug level")
log.SetLevel(log.LevelDebug)
log.Debug("hello debug")
log.Info("hello info")
log.Error("hello error")

log.Info("info hello log")
fmt.Println("info level")
log.SetLevel(log.LevelInfo)
log.Debug("hello debug")
log.Info("hello info")
log.Error("hello error")

log.Error("error log")
fmt.Println("error level")
log.SetLevel(log.LevelError)
log.Debug("hello debug")
log.Info("hello info")
log.Error("hello error")

}

0 comments on commit 7d31147

Please sign in to comment.