对接
This commit is contained in:
@@ -435,6 +435,8 @@ func routedLogPaths(module string, level zapcore.Level) []string {
|
||||
paths = append(paths, filepath.Join("timedTask", "task.log"))
|
||||
case "websocket":
|
||||
paths = append(paths, filepath.Join("websocket", "websocket.log"))
|
||||
case "live":
|
||||
paths = append(paths, filepath.Join("live", "live.log"))
|
||||
case "error":
|
||||
paths = append(paths, filepath.Join("error", "error.log"))
|
||||
default:
|
||||
|
||||
@@ -42,6 +42,7 @@ func TestZapHandlerRoutesHTTPAndErrorLogs(t *testing.T) {
|
||||
logger := slog.New(handler)
|
||||
logger.Info("request", "mod", "http", "request_id", "req-1")
|
||||
logger.Info("handshake", "mod", "websocket")
|
||||
logger.Info("publisher joined", "mod", "live")
|
||||
logger.Error("failed", "mod", "users")
|
||||
cleanup()
|
||||
|
||||
@@ -54,6 +55,7 @@ func TestZapHandlerRoutesHTTPAndErrorLogs(t *testing.T) {
|
||||
filepath.Join(root, date, "application.log"),
|
||||
filepath.Join(root, date, "http", "access.log"),
|
||||
filepath.Join(root, date, "websocket", "websocket.log"),
|
||||
filepath.Join(root, date, "live", "live.log"),
|
||||
filepath.Join(root, date, "users", "application.log"),
|
||||
filepath.Join(root, date, "error", "error.log"),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user