packet name pb

This commit is contained in:
withchao
2023-03-16 10:46:06 +08:00
parent 8437c9a38b
commit 17de3e7927
208 changed files with 25300 additions and 15564 deletions
+6 -6
View File
@@ -7,9 +7,9 @@
package log
import (
"OpenIM/pkg/common/config"
"context"
"fmt"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
elasticV7 "github.com/olivere/elastic/v7"
"github.com/sirupsen/logrus"
"log"
@@ -18,13 +18,13 @@ import (
"time"
)
//esHook CUSTOMIZED ES hook
// esHook CUSTOMIZED ES hook
type esHook struct {
moduleName string
client *elasticV7.Client
}
//newEsHook Initialization
// newEsHook Initialization
func newEsHook(moduleName string) *esHook {
//https://github.com/sohlich/elogrus
//client, err := elastic.NewClient(elastic.SetURL("http://localhost:9200"))
@@ -61,7 +61,7 @@ func newEsHook(moduleName string) *esHook {
return &esHook{client: es, moduleName: moduleName}
}
//Fire log hook interface
// Fire log hook interface
func (hook *esHook) Fire(entry *logrus.Entry) error {
doc := newEsLog(entry)
go hook.sendEs(doc)
@@ -72,7 +72,7 @@ func (hook *esHook) Levels() []logrus.Level {
return logrus.AllLevels
}
//sendEs
// sendEs
func (hook *esHook) sendEs(doc appLogDocModel) {
defer func() {
if r := recover(); r != nil {
@@ -86,7 +86,7 @@ func (hook *esHook) sendEs(doc appLogDocModel) {
}
//appLogDocModel es model
// appLogDocModel es model
type appLogDocModel map[string]interface{}
func newEsLog(e *logrus.Entry) appLogDocModel {
+1 -1
View File
@@ -7,7 +7,7 @@
package log
import (
"OpenIM/pkg/utils"
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
"github.com/sirupsen/logrus"
"runtime"
"strings"
+1 -1
View File
@@ -1,7 +1,7 @@
package log
import (
"OpenIM/pkg/common/config"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
nested "github.com/antonfisher/nested-logrus-formatter"
rotatelogs "github.com/lestrrat-go/file-rotatelogs"
"github.com/rifflock/lfshook"
+4 -4
View File
@@ -1,10 +1,10 @@
package log
import (
"OpenIM/pkg/common/config"
"OpenIM/pkg/common/tracelog"
"bufio"
"context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/tracelog"
//"bufio"
"fmt"
@@ -128,7 +128,7 @@ func Debug(OperationID string, args ...interface{}) {
}).Debugln(args)
}
//Deprecated
// Deprecated
func Warning(token, OperationID, format string, args ...interface{}) {
logger.WithFields(logrus.Fields{
"PID": logger.Pid,
@@ -137,7 +137,7 @@ func Warning(token, OperationID, format string, args ...interface{}) {
}
//internal method
// internal method
func argsHandle(OperationID string, fields logrus.Fields, args []interface{}) {
for i := 0; i < len(args); i += 2 {
if i+1 < len(args) {
+3 -3
View File
@@ -1,10 +1,10 @@
package log
import (
"OpenIM/pkg/common/config"
"OpenIM/pkg/common/constant"
"OpenIM/pkg/common/tracelog"
"context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/tracelog"
rotatelogs "github.com/lestrrat-go/file-rotatelogs"
"os"
"path/filepath"