-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mobus
committed
Mar 17, 2022
1 parent
7d31147
commit 48f3d01
Showing
4 changed files
with
84 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,12 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/sunvim/utils/log" | ||
) | ||
|
||
func main() { | ||
log.SetPrefix("Example") | ||
|
||
fmt.Println("debug level") | ||
log.SetLevel(log.LevelDebug) | ||
log.Debug("hello debug") | ||
log.Info("hello info") | ||
log.Error("hello error") | ||
|
||
fmt.Println("info level") | ||
log.SetLevel(log.LevelInfo) | ||
log.Debug("hello debug") | ||
log.Info("hello info") | ||
log.Error("hello error") | ||
logger := log.NewLogger() | ||
|
||
fmt.Println("error level") | ||
log.SetLevel(log.LevelError) | ||
log.Debug("hello debug") | ||
log.Info("hello info") | ||
log.Error("hello error") | ||
logger.Info().Str("hello", "world").Msg("main") | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters