mirror of
https://github.com/astaxie/beego.git
synced 2024-12-22 17:10:50 +00:00
make example runable
This commit is contained in:
parent
0f73050567
commit
1fd7fa5df7
@ -25,15 +25,15 @@ import (
|
||||
Then init a Log (example with console adapter)
|
||||
|
||||
```golang
|
||||
log := NewLogger(10000)
|
||||
log.SetLogger("console", "")
|
||||
log := logs.NewLogger(10000)
|
||||
log.SetLogger("console", "")
|
||||
```
|
||||
|
||||
> the first params stand for how many channel
|
||||
|
||||
Use it like this:
|
||||
|
||||
```golang
|
||||
|
||||
```golang
|
||||
log.Trace("trace")
|
||||
log.Info("info")
|
||||
log.Warn("warning")
|
||||
@ -44,8 +44,8 @@ log.Critical("critical")
|
||||
## File adapter
|
||||
|
||||
Configure file adapter like this:
|
||||
|
||||
```golang
|
||||
|
||||
```golang
|
||||
log := NewLogger(10000)
|
||||
log.SetLogger("file", `{"filename":"test.log"}`)
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user