Reduce log noise (#108)
Cannot guarantee that all noisy logs can be removed at once. Comment them instead of removing them to make it easier to merge upstream. What have been removed in this PR are those that are very very long and almost unreadable logs, like <img width="839" alt="image" src="/attachments/b59e1dcc-4edd-4f81-b939-83dcc45f2ed2"> Reviewed-on: https://gitea.com/gitea/act/pulls/108 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
e1b1e81124
commit
517d11c671
|
@ -6,6 +6,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
|
|
||||||
"github.com/nektos/act/pkg/common"
|
"github.com/nektos/act/pkg/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -22,7 +23,8 @@ func NewDockerNetworkCreateExecutor(name string) common.Executor {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
common.Logger(ctx).Debugf("%v", networks)
|
// For Gitea, reduce log noise
|
||||||
|
// common.Logger(ctx).Debugf("%v", networks)
|
||||||
for _, network := range networks {
|
for _, network := range networks {
|
||||||
if network.Name == name {
|
if network.Name == name {
|
||||||
common.Logger(ctx).Debugf("Network %v exists", name)
|
common.Logger(ctx).Debugf("Network %v exists", name)
|
||||||
|
@ -56,7 +58,8 @@ func NewDockerNetworkRemoveExecutor(name string) common.Executor {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
common.Logger(ctx).Debugf("%v", networks)
|
// For Gitea, reduce log noise
|
||||||
|
// common.Logger(ctx).Debugf("%v", networks)
|
||||||
for _, network := range networks {
|
for _, network := range networks {
|
||||||
if network.Name == name {
|
if network.Name == name {
|
||||||
result, err := cli.NetworkInspect(ctx, network.ID, types.NetworkInspectOptions{})
|
result, err := cli.NetworkInspect(ctx, network.ID, types.NetworkInspectOptions{})
|
||||||
|
|
|
@ -445,7 +445,8 @@ func (cr *containerReference) create(capAdd []string, capDrop []string) common.E
|
||||||
ExposedPorts: input.ExposedPorts,
|
ExposedPorts: input.ExposedPorts,
|
||||||
Tty: isTerminal,
|
Tty: isTerminal,
|
||||||
}
|
}
|
||||||
logger.Debugf("Common container.Config ==> %+v", config)
|
// For Gitea, reduce log noise
|
||||||
|
// logger.Debugf("Common container.Config ==> %+v", config)
|
||||||
|
|
||||||
if len(input.Cmd) != 0 {
|
if len(input.Cmd) != 0 {
|
||||||
config.Cmd = input.Cmd
|
config.Cmd = input.Cmd
|
||||||
|
@ -489,7 +490,8 @@ func (cr *containerReference) create(capAdd []string, capDrop []string) common.E
|
||||||
PortBindings: input.PortBindings,
|
PortBindings: input.PortBindings,
|
||||||
AutoRemove: input.AutoRemove,
|
AutoRemove: input.AutoRemove,
|
||||||
}
|
}
|
||||||
logger.Debugf("Common container.HostConfig ==> %+v", hostConfig)
|
// For Gitea, reduce log noise
|
||||||
|
// logger.Debugf("Common container.HostConfig ==> %+v", hostConfig)
|
||||||
|
|
||||||
config, hostConfig, err := cr.mergeContainerConfigs(ctx, config, hostConfig)
|
config, hostConfig, err := cr.mergeContainerConfigs(ctx, config, hostConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -500,7 +502,8 @@ func (cr *containerReference) create(capAdd []string, capDrop []string) common.E
|
||||||
config, hostConfig = cr.sanitizeConfig(ctx, config, hostConfig)
|
config, hostConfig = cr.sanitizeConfig(ctx, config, hostConfig)
|
||||||
|
|
||||||
var networkingConfig *network.NetworkingConfig
|
var networkingConfig *network.NetworkingConfig
|
||||||
logger.Debugf("input.NetworkAliases ==> %v", input.NetworkAliases)
|
// For Gitea, reduce log noise
|
||||||
|
// logger.Debugf("input.NetworkAliases ==> %v", input.NetworkAliases)
|
||||||
n := hostConfig.NetworkMode
|
n := hostConfig.NetworkMode
|
||||||
// IsUserDefined and IsHost are broken on windows
|
// IsUserDefined and IsHost are broken on windows
|
||||||
if n.IsUserDefined() && n != "host" && len(input.NetworkAliases) > 0 {
|
if n.IsUserDefined() && n != "host" && len(input.NetworkAliases) > 0 {
|
||||||
|
|
|
@ -112,7 +112,8 @@ func readActionImpl(ctx context.Context, step *model.Step, actionDir string, act
|
||||||
defer closer.Close()
|
defer closer.Close()
|
||||||
|
|
||||||
action, err := model.ReadAction(reader)
|
action, err := model.ReadAction(reader)
|
||||||
logger.Debugf("Read action %v from '%s'", action, "Unknown")
|
// For Gitea, reduce log noise
|
||||||
|
// logger.Debugf("Read action %v from '%s'", action, "Unknown")
|
||||||
return action, err
|
return action, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,7 +163,8 @@ func runActionImpl(step actionStep, actionDir string, remoteAction *remoteAction
|
||||||
}
|
}
|
||||||
|
|
||||||
action := step.getActionModel()
|
action := step.getActionModel()
|
||||||
logger.Debugf("About to run action %v", action)
|
// For Gitea, reduce log noise
|
||||||
|
// logger.Debugf("About to run action %v", action)
|
||||||
|
|
||||||
err := setupActionEnv(ctx, step, remoteAction)
|
err := setupActionEnv(ctx, step, remoteAction)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -221,7 +221,8 @@ func setupEnv(ctx context.Context, step step) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
common.Logger(ctx).Debugf("setupEnv => %v", *step.getEnv())
|
// For Gitea, reduce log noise
|
||||||
|
// common.Logger(ctx).Debugf("setupEnv => %v", *step.getEnv())
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue