mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-05-15 00:50:25 +02:00
refactor: replace Unix socket log communication with HTTP-based system
Replace the legacy Unix socket log communication between `ctrld start` and `ctrld run` with a modern HTTP-based system for better reliability and maintainability. Benefits: - More reliable communication protocol using standard HTTP - Better error handling and connection management - Cleaner separation of concerns with dedicated endpoints - Easier to test and debug with HTTP-based communication - More maintainable code with proper abstraction layers This change maintains backward compatibility while providing a more robust foundation for inter-process communication between ctrld commands.
This commit is contained in:
committed by
Cuong Manh Le
parent
a04babbbc3
commit
56f8113bb0
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"go.uber.org/zap"
|
||||
@@ -244,7 +245,8 @@ func (l *Logger) GetLogger() *Logger {
|
||||
|
||||
// Write implements io.Writer to allow direct writing to the logger
|
||||
func (l *Logger) Write(p []byte) (n int, err error) {
|
||||
l.Info().Msg(string(p))
|
||||
stdoutSyncer := zapcore.AddSync(os.Stdout)
|
||||
stdoutSyncer.Write(p)
|
||||
return len(p), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user