mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-09 08:26:47 +00:00
Reduce logging from log streaming command
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
parent
a8b61f2086
commit
4ab5f60b9d
@ -105,12 +105,12 @@ func streamLogs(ctx context.Context, cmd *exec.Cmd, out io.ReadCloser, msgs chan
|
|||||||
|
|
||||||
// will ensure `out` is closed and all related resources cleaned up
|
// will ensure `out` is closed and all related resources cleaned up
|
||||||
go func() {
|
go func() {
|
||||||
err := cmd.Wait()
|
if err := cmd.Wait(); err != nil {
|
||||||
log.Println("wait result", err)
|
log.Printf("journalctl exited with error: %s", err)
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
log.Println("closing journal stream")
|
|
||||||
close(msgs)
|
close(msgs)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@ -176,7 +176,6 @@ func parseEntry(entry map[string]string) (logs.Message, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func logErrOut(out io.ReadCloser) {
|
func logErrOut(out io.ReadCloser) {
|
||||||
defer log.Println("stderr closed")
|
|
||||||
defer out.Close()
|
defer out.Close()
|
||||||
|
|
||||||
io.Copy(log.Writer(), out)
|
io.Copy(log.Writer(), out)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user