1
- # Clog
1
+ # Clog
2
2
3
3
[ ![ GitHub Workflow Status] ( https://img.shields.io/github/workflow/status/go-clog/clog/Go?logo=github&style=for-the-badge )] ( https://github.com/go-clog/clog/actions?query=workflow%3AGo )
4
4
[ ![ codecov] ( https://img.shields.io/codecov/c/github/go-clog/clog/master?logo=codecov&style=for-the-badge )] ( https://codecov.io/gh/go-clog/clog )
@@ -13,10 +13,10 @@ This package supports multiple loggers across different levels of logging. It us
13
13
14
14
## Installation
15
15
16
- The minimum requirement of Go is ** 1.11 ** .
16
+ The minimum requirement of Go is ** 1.19 ** .
17
17
18
18
go get unknwon.dev/clog/v2
19
-
19
+
20
20
Please apply ` -u ` flag to update in the future.
21
21
22
22
## Getting Started
@@ -51,7 +51,7 @@ The code inside `init` function is equivalent to the following:
51
51
52
52
``` go
53
53
func init () {
54
- err := log.NewConsole (0 ,
54
+ err := log.NewConsole (0 ,
55
55
log.ConsoleConfig {
56
56
Level: log.LevelTrace ,
57
57
},
@@ -66,7 +66,7 @@ Or expand further:
66
66
67
67
``` go
68
68
func init () {
69
- err := log.NewConsoleWithName (log.DefaultConsoleName , 0 ,
69
+ err := log.NewConsoleWithName (log.DefaultConsoleName , 0 ,
70
70
log.ConsoleConfig {
71
71
Level: log.LevelTrace ,
72
72
},
@@ -85,7 +85,7 @@ In production, you may want to make log less verbose and be asynchronous:
85
85
86
86
``` go
87
87
func init () {
88
- // The buffer size mainly depends on number of logs could be produced at the same time,
88
+ // The buffer size mainly depends on number of logs could be produced at the same time,
89
89
// 100 is a good default.
90
90
err := log.NewConsole (100 ,
91
91
log.ConsoleConfig {
@@ -145,7 +145,7 @@ func main() {
145
145
146
146
### Caller Location
147
147
148
- When using ` log.Error ` and ` log.Fatal ` functions, the caller location is written along with logs.
148
+ When using ` log.Error ` and ` log.Fatal ` functions, the caller location is written along with logs.
149
149
150
150
``` go
151
151
func main () {
@@ -171,10 +171,10 @@ File logger is the single most powerful builtin logger, it has the ability to ro
171
171
172
172
``` go
173
173
func init () {
174
- err := log.NewFile (100 ,
174
+ err := log.NewFile (100 ,
175
175
log.FileConfig {
176
176
Level: log.LevelInfo ,
177
- Filename: " clog.log" ,
177
+ Filename: " clog.log" ,
178
178
FileRotationConfig: log.FileRotationConfig {
179
179
Rotate: true ,
180
180
Daily: true ,
0 commit comments