build: separate sublogger and rotator pipe management

These are two separate concerns. So this commit splits them up and just
passes a LogWriter from the one to the other. This will become cleaner
in an upcoming commit where the Rotator will implement io.Writer and
there will no longer be a need for LogWriter.
This commit is contained in:
Elle Mouton committed 2024-10-22 15:19:58 +02:00
1 parent ec5b39c120
commit 387a1a8831
6 files changed
+169 -107

No files matched your search

+3 -3
View File
@@ -7341,7 +7341,7 @@ func (r *rpcServer) DebugLevel(ctx context.Context,
if req.Show {
return &lnrpc.DebugLevelResponse{
SubSystems: strings.Join(
r.cfg.LogWriter.SupportedSubsystems(), " ",
r.cfg.SubLogMgr.SupportedSubsystems(), " ",
),
}, nil
}
@@ -7350,12 +7350,12 @@ func (r *rpcServer) DebugLevel(ctx context.Context,
// Otherwise, we'll attempt to set the logging level using the
// specified level spec.
err := build.ParseAndSetDebugLevels(req.LevelSpec, r.cfg.LogWriter)
err := build.ParseAndSetDebugLevels(req.LevelSpec, r.cfg.SubLogMgr)
if err != nil {
return nil, err
}
subLoggers := r.cfg.LogWriter.SubLoggers()
subLoggers := r.cfg.SubLogMgr.SubLoggers()
// Sort alphabetically by subsystem name.
var tags []string
for t := range subLoggers {