|
|
|
@ -4,7 +4,7 @@ package pmuxlib |
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"context" |
|
|
|
|
"os" |
|
|
|
|
"io" |
|
|
|
|
"sync" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
@ -16,12 +16,16 @@ type Config struct { |
|
|
|
|
// Run runs the given configuration as if this was a real pmux process. It will
|
|
|
|
|
// block until the context is canceled and all child processes have been cleaned
|
|
|
|
|
// up.
|
|
|
|
|
func Run(ctx context.Context, cfg Config) { |
|
|
|
|
func Run( |
|
|
|
|
ctx context.Context, |
|
|
|
|
stdout, stderr io.Writer, |
|
|
|
|
cfg Config, |
|
|
|
|
) { |
|
|
|
|
|
|
|
|
|
stdoutLogger := newLogger(os.Stdout, logSepStdout, cfg.TimeFormat) |
|
|
|
|
stdoutLogger := newLogger(stdout, logSepStdout, cfg.TimeFormat) |
|
|
|
|
defer stdoutLogger.Close() |
|
|
|
|
|
|
|
|
|
stderrLogger := newLogger(os.Stderr, logSepStderr, cfg.TimeFormat) |
|
|
|
|
stderrLogger := newLogger(stderr, logSepStderr, cfg.TimeFormat) |
|
|
|
|
defer stderrLogger.Close() |
|
|
|
|
|
|
|
|
|
sysLogger := stderrLogger.withSep(logSepSys) |
|
|
|
|