diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2021-04-10 16:25:45 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-04-11 17:07:49 +1000 |
commit | 74320f00752926b42f0e4d6f84b3816d7a0134a9 (patch) | |
tree | f02514330a4c1494c7233a11312d6a194c9d9122 /pkg/commands/oscommands | |
parent | bfad972f0c75bb0fb4a60cf6848c1ab205254d87 (diff) |
more logging of commands
Diffstat (limited to 'pkg/commands/oscommands')
-rw-r--r-- | pkg/commands/oscommands/os.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/commands/oscommands/os.go b/pkg/commands/oscommands/os.go index 2c85cfc5a..55592692f 100644 --- a/pkg/commands/oscommands/os.go +++ b/pkg/commands/oscommands/os.go @@ -94,6 +94,13 @@ func NewOSCommand(log *logrus.Entry, config config.AppConfigurer) *OSCommand { } func (c *OSCommand) WithSpan(span string) *OSCommand { + // sometimes .WithSpan(span) will be called where span actually is empty, in + // which case we don't need to log anything so we can just return early here + // with the original struct + if span == "" { + return c + } + newOSCommand := &OSCommand{} *newOSCommand = *c newOSCommand.CmdLogSpan = span |