Skip to content

Commit

Permalink
update for log
Browse files Browse the repository at this point in the history
  • Loading branch information
name5566 committed Apr 27, 2017
1 parent c82b2f9 commit 95e8d5b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions TUTORIAL_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,15 @@ Debug < Release < Error < Fatal (In priority level)

For LeafServer, bin/conf/server.json is used to configure log level which will filter out the lower level log information. Fatal level log is sort of different and comes only when the game server exit. Usually it records the information when the game server is failed to start up.

Set LogFlag (LeafServer conf/conf.go) to output the file name and the line number:

```
LogFlag = log.Lshortfile
```

LogFlag:[https://golang.org/pkg/log/#pkg-constants](https://golang.org/pkg/log/#pkg-constants)


More references are at [leaf/log](https://github.com/name5566/leaf/blob/master/log).

### Leaf recordfile
Expand Down
9 changes: 9 additions & 0 deletions TUTORIAL_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,15 @@ Debug < Release < Error < Fatal(日志级别高低)

在 LeafServer 中,bin/conf/server.json 可以配置日志级别,低于配置的日志级别的日志将不会输出。Fatal 日志比较特殊,每次输出 Fatal 日志之后游戏服务器进程就会结束,通常来说,只在游戏服务器初始化失败时使用 Fatal 日志。

我们还可以通过配置 LeafServer conf/conf.go 的 LogFlag 来在日志中输出文件名和行号:

```
LogFlag = log.Lshortfile
```

可用的 LogFlag 见:[https://golang.org/pkg/log/#pkg-constants](https://golang.org/pkg/log/#pkg-constants)


更加详细的用法可以参考 [leaf/log](https://github.com/name5566/leaf/blob/master/log)

### Leaf recordfile
Expand Down

0 comments on commit 95e8d5b

Please sign in to comment.