-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
Currently I've found solution to create wrapper for Logger such as:
type ProcessLogger struct {
logging.Logger
}
func (pl *ProcessLogger) Write(p []byte) (n int, err error) {
pl.Debug(string(p))
return len(p), nil
}and use this option when creating a new Process to set it for both out and err:
cn-infra/exec/processmanager/process_options.go
Lines 74 to 80 in 42c7431
| // Writer allows to use custom writer instance. Can be defined with nil parameters, in such a case | |
| // standard output will be used | |
| func Writer(outW, errW io.Writer) POption { | |
| return func(p *POptions) { | |
| p.outWriter, p.errWriter = outW, errW | |
| } | |
| } |
It would be nice if this template code could be avoided.
I'm not sure if this requires changes in processmanager or logging packages.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels