filter out useless commandConn.CloseWrite warning message

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2022-04-13 02:18:59 +02:00
parent 464c7ad708
commit aeb8ea3973
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
2 changed files with 13 additions and 0 deletions

View File

@ -4,7 +4,9 @@ import (
"os" "os"
"strings" "strings"
"github.com/docker/buildx/util/logutil"
"github.com/moby/buildkit/util/appcontext" "github.com/moby/buildkit/util/appcontext"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/viper" "github.com/spf13/viper"
"go.dagger.io/dagger/cmd/dagger/cmd/project" "go.dagger.io/dagger/cmd/dagger/cmd/project"
@ -21,6 +23,16 @@ var rootCmd = &cobra.Command{
} }
func init() { func init() {
// filter out useless commandConn.CloseWrite warning message that can occur
// when dagger runs for the first time. This should be fixed upstream:
// unreachable: "commandConn.CloseWrite: commandconn: failed to wait: signal: killed"
// https://github.com/docker/cli/blob/3fb4fb83dfb5db0c0753a8316f21aea54dab32c5/cli/connhelper/commandconn/commandconn.go#L203-L214
logrus.AddHook(logutil.NewFilter([]logrus.Level{
logrus.WarnLevel,
},
"commandConn.CloseWrite:",
))
rootCmd.PersistentFlags().String("log-format", "auto", "Log format (auto, plain, tty, json)") rootCmd.PersistentFlags().String("log-format", "auto", "Log format (auto, plain, tty, json)")
rootCmd.PersistentFlags().StringP("log-level", "l", "info", "Log level") rootCmd.PersistentFlags().StringP("log-level", "l", "info", "Log level")
rootCmd.PersistentFlags().Bool("experimental", false, "Enable experimental features") rootCmd.PersistentFlags().Bool("experimental", false, "Enable experimental features")

1
go.mod
View File

@ -25,6 +25,7 @@ require (
github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799
github.com/rs/zerolog v1.26.1 github.com/rs/zerolog v1.26.1
github.com/sergi/go-diff v1.2.0 github.com/sergi/go-diff v1.2.0
github.com/sirupsen/logrus v1.8.1
github.com/spf13/cobra v1.4.0 github.com/spf13/cobra v1.4.0
github.com/spf13/viper v1.10.0 github.com/spf13/viper v1.10.0
github.com/stretchr/testify v1.7.1 github.com/stretchr/testify v1.7.1