Skip to content

Commit

Permalink
feat(log): add dummyLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
Matrix-X committed Aug 11, 2024
1 parent 3d0bc2d commit 2af098d
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions docs/zh/start/common.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ PowerWeChat提供了日志模块,默认情况下,日志会输出到控制台

Log: work.Log{
Level: "debug",
//Level: "error",
//Level: "off",
File: "./wechat.log",
},

Expand All @@ -150,10 +148,16 @@ PowerWeChat提供了自定义日志模块,可以自定义日志格式、输出

```go

import (
"github.com/ArtisanCloud/PowerLibs/v3/logger/drivers"
....
)

Log: miniProgram.Log{
Driver: &testLogDriver.SimpleLogger{},
Driver: &drivers.SimpleLogger{},
Level: "debug",
File: "./wechat.log",
File: "./wechat_info.log",
Error: "./wechat_error.log",
},

```
Expand Down Expand Up @@ -194,4 +198,15 @@ FatalF(format string, args ...interface{})
```

### 关闭日志
请将level设置成off,即可关闭日志输出。
```go

import (
"github.com/ArtisanCloud/PowerLibs/v3/logger/drivers"
....
)

Log: miniProgram.Log{
Driver: &drivers.DummyLogger{},
},

```

0 comments on commit 2af098d

Please sign in to comment.