mirror of
https://github.com/e1732a364fed/v2ray_simple.git
synced 2025-12-24 13:27:56 +08:00
在标准 toml 配置中 配置 logfile 配置文件路径。 如 `logfile = "/var/log/verysimple/vs_log"` 将 -sp 的行为 改为 打印完毕后立即退出。
29 lines
390 B
Go
29 lines
390 B
Go
package utils
|
|
|
|
import (
|
|
"errors"
|
|
"testing"
|
|
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
func TestZaplog(t *testing.T) {
|
|
|
|
LogLevel = Log_info
|
|
InitLog("")
|
|
|
|
if ce := CanLogDebug("test1"); ce != nil {
|
|
ce.Write(
|
|
zap.Uint32("uid", 32),
|
|
zap.Error(errors.New("asdfdsf")),
|
|
)
|
|
}
|
|
|
|
if ce := CanLogInfo("test2"); ce != nil {
|
|
ce.Write(
|
|
zap.Uint32("uid", 32),
|
|
zap.Error(errors.New("asdfdsf")),
|
|
)
|
|
}
|
|
}
|