Skip to content

Commit

Permalink
实现接口Writer
Browse files Browse the repository at this point in the history
  • Loading branch information
jayyi committed Nov 30, 2020
1 parent 7ee3d13 commit c7c5291
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions simlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,14 @@ func (this* SimLogger) formatLogLineHeader(logLevel LogLevel, file string, line
}
}

// 实际接口 Writer:
// type Writer interface {
// Write(p []byte) (n int, err error)
// }
func (this* SimLogger) Write(p []byte) (int, error) {
return this.writeLog(string(p))
}

func (this* SimLogger) writeLog(logLine string) (int, error) {
// 日志打屏
if atomic.LoadInt32(&this.printScreen) == 1 {
Expand Down

0 comments on commit c7c5291

Please sign in to comment.