内容压缩支持对已压缩内容重新压缩

This commit is contained in:
GoEdgeLab
2021-10-18 16:50:06 +08:00
parent 91e82dde8e
commit 1a2681be03
9 changed files with 233 additions and 7 deletions

View File

@@ -39,21 +39,22 @@ func (this *LogWriter) Init() {
func (this *LogWriter) Write(message string) {
// 文件和行号
var callDepth = 3
var callDepth = 2
var file string
var line int
var ok bool
_, file, line, ok = runtime.Caller(callDepth)
if !ok {
file = "???"
line = 0
} else {
if ok {
file = filepath.Base(file)
}
backgroundEnv, _ := os.LookupEnv("EdgeBackground")
if backgroundEnv != "on" {
log.Println(message + " (" + file + ":" + strconv.Itoa(line) + ")")
if len(file) > 0 {
log.Println(message + " (" + file + ":" + strconv.Itoa(line) + ")")
} else {
log.Println(message)
}
}
if this.fileAppender != nil {