Skip to content

Commit f7f4c3a

Browse files
authored
README: refine words and fix typos
[SKIP CI]
1 parent 3ef746c commit f7f4c3a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,14 @@ func init() {
5959

6060
- The `0` is an integer type so it is used as underlying buffer size. In this case, `0` creates synchronized logger (call hangs until write is finished).
6161
- Any non-integer type is used as the config object, in this case `ConsoleConfig` is the respective config object for the console logger.
62-
- The `LevelTrace` used here is the lowest logging level, meaning prints every log to the console. All levels from lowest to highest are: `LevelTrace`, `LevelInfo`, `LevelWarn`, `LevelError`, `LevelFatal`, each of has at least one repective function, e.g. `log.Trace`, `log.Info`, `log.Warn`, `log.Error` and `log.Fatal`.
62+
- The `LevelTrace` used here is the lowest logging level, meaning prints every log to the console. All levels from lowest to highest are: `LevelTrace`, `LevelInfo`, `LevelWarn`, `LevelError`, `LevelFatal`, each of them has at least one respective function, e.g. `log.Trace`, `log.Info`, `log.Warn`, `log.Error` and `log.Fatal`.
6363

6464
In production, you may want to make log less verbose and be asynchronous:
6565

6666
```go
6767
func init() {
68-
// The buffer size mainly depends on how many logs will be produced at the same time, 100 is a good default.
68+
// The buffer size mainly depends on number of logs could be produced at the same time,
69+
// 100 is a good default.
6970
err := log.New(log.ModeConsole, 100, log.ConsoleConfig{
7071
Level: log.LevelInfo,
7172
})
@@ -78,11 +79,11 @@ func init() {
7879
- When you set level to be `LevelInfo`, calls to the `log.Trace` will be simply noop.
7980
- The console logger comes with color output, but for non-colorable destination, the color output will be disabled automatically.
8081

81-
Other builtin loggers are file (`log.ModeFile`), Slack (`log.ModeSlack`) and Discord (`log.Discord`), see later in the documentation for usage details.
82+
Other builtin loggers are file (`log.ModeFile`), Slack (`log.ModeSlack`) and Discord (`log.ModeDiscord`), see later sections in the documentation for usage details.
8283

8384
### Multiple Loggers
8485

85-
You can have multiple loggers in different modes with levels.
86+
You can have multiple loggers in different modes across levels.
8687

8788
```go
8889
func init() {
@@ -91,8 +92,8 @@ func init() {
9192
panic("unable to create new logger: " + err.Error())
9293
}
9394
err := log.New(log.ModeFile, log.FileConfig{
94-
Level: log.LevelInfo,
95-
Filename: "clog.log",
95+
Level: log.LevelInfo,
96+
Filename: "clog.log",
9697
})
9798
if err != nil {
9899
panic("unable to create new logger: " + err.Error())

0 commit comments

Comments
 (0)