add rawlog

This commit is contained in:
zhiqiang feng
2020-12-28 16:36:59 +08:00
parent f9c71978fd
commit 68069dec34
2 changed files with 11 additions and 2 deletions
+4
View File
@@ -3,6 +3,8 @@ package utils
import (
"regexp"
"strings"
rotatelogs "github.com/lestrrat-go/file-rotatelogs"
)
const (
@@ -11,6 +13,7 @@ const (
)
var buffer []byte
var RawLog *rotatelogs.RotateLogs
func Append(data []byte) {
buffer = append(buffer, data...)
@@ -28,6 +31,7 @@ func check() {
if len(telegram) > 0 {
// Log.Info("telegram ", zap.String("text", telegram))
RawLog.Write([]byte(telegram))
buffer = nil
InsertTelegram(telegram)
}