完成日志输出到文件、终端多处的处理
This commit is contained in:
@@ -3,7 +3,7 @@ package video
|
||||
import (
|
||||
"bufio"
|
||||
"context"
|
||||
"game-driver/pkg/logger"
|
||||
"go.uber.org/zap"
|
||||
"io"
|
||||
"os/exec"
|
||||
"sync"
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
func Play(ctx context.Context, file string) error {
|
||||
if file == "" {
|
||||
logger.Infoln("video file is empty")
|
||||
zap.S().Infoln("video file is empty")
|
||||
return nil
|
||||
}
|
||||
cmd := exec.CommandContext(ctx, "ffplay", "-autoexit", "-fs", file)
|
||||
@@ -40,7 +40,7 @@ func Play(ctx context.Context, file string) error {
|
||||
}
|
||||
break
|
||||
}
|
||||
logger.Infoln(string(line))
|
||||
zap.S().Infoln(string(line))
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user