modify logger

This commit is contained in:
fengzhiqiang
2020-12-28 13:00:16 +08:00
parent c37f4b081f
commit 2d8f5c7907
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ import (
"os"
"os/signal"
"syscall"
"fmt"
"it2000.com.cn/tele-recv/utils"
"github.com/spf13/cobra"
@@ -92,7 +92,7 @@ func start() {
buffer, count := utils.ReadPort()
if count > 0 {
if lograw {
l.Info(string(buffer))
fmt.Print(string(buffer))
}
utils.Append(buffer)
}
+1 -1
View File
@@ -45,7 +45,7 @@ func OpenPort(device string, baudrate int, bytesize byte, stopbits byte) error {
//ReadPort read byte array from port
func ReadPort() ([]byte, int) {
buffer := make([]byte, 256)
buffer := make([]byte, 1)
if !ServerRunning {
return buffer, 0
}
+2 -2
View File
@@ -82,9 +82,9 @@ func InsertTelegram(teleString string) {
checkDbErr(err, "error in insert telegram ")
isWriting = false
if insertSQL == InsertOld {
Log.Infof("telegram [%n] processed ", id)
Log.Infof("telegram [%s] processed ", id)
} else {
Log.Infof("telegram [%n] saved ", id)
Log.Infof("telegram [%s] saved ", id)
}
}