-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update readme, update some preivew images
- Loading branch information
Showing
8 changed files
with
64 additions
and
8 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# diff with zap, zerolog | ||
|
||
是的,zap 非常快速。 | ||
|
||
但是有一点问题: | ||
|
||
- 配置起来稍显复杂 | ||
- 没有内置切割文件处理和文件清理 | ||
- 自定义扩展性不是很好 | ||
|
||
Yes, zap is very fast. | ||
|
||
But there is a little problem: | ||
|
||
- Slightly complicated to configure | ||
- No built-in cutting file handling, file cleanup | ||
- Custom extensibility is not very good |
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package main | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/gookit/goutil/errorx" | ||
"github.com/gookit/slog" | ||
"github.com/gookit/slog/handler" | ||
) | ||
|
||
// run: go run ./_example/slog_all_level.go | ||
func main() { | ||
l := slog.NewWithConfig(func(l *slog.Logger) { | ||
l.DoNothingOnPanicFatal() | ||
}) | ||
|
||
l.AddHandler(handler.NewConsoleHandler(slog.AllLevels)) | ||
printAllLevel(l, "this a", "log", "message") | ||
} | ||
|
||
func printAllLevel(l *slog.Logger, args ...interface{}) { | ||
l.Debug(args...) | ||
l.Info(args...) | ||
l.Warn(args...) | ||
l.Error(args...) | ||
l.Print(args...) | ||
l.Println(args...) | ||
l.Fatal(args...) | ||
l.Fatalln(args...) | ||
l.Panic(args...) | ||
l.Panicln(args...) | ||
|
||
l.Trace(args...) | ||
l.Notice(args...) | ||
l.ErrorT(errors.New("a error object")) | ||
l.ErrorT(errorx.New("error with stack info")) | ||
} |