mirror of
https://gitee.com/johng/gf.git
synced 2024-12-03 20:58:47 +08:00
Merge pull request #1369 from wangle201210/develop
fix print log on windows
This commit is contained in:
commit
fb5a1f2306
@ -9,6 +9,7 @@ package glog
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/fatih/color"
|
||||
"github.com/gogf/gf/container/gtype"
|
||||
"github.com/gogf/gf/internal/intlog"
|
||||
"github.com/gogf/gf/os/gfpool"
|
||||
@ -250,7 +251,7 @@ func (l *Logger) printToWriter(ctx context.Context, input *HandlerInput) {
|
||||
// printToStdout outputs logging content to stdout.
|
||||
func (l *Logger) printToStdout(ctx context.Context, input *HandlerInput) {
|
||||
if l.config.StdoutPrint {
|
||||
if _, err := os.Stdout.Write(input.getBuffer(true).Bytes()); err != nil {
|
||||
if _, err := fmt.Fprintf(color.Output, input.getBuffer(true).String()); err != nil {
|
||||
intlog.Error(ctx, err)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user