Skip to content

Commit

Permalink
private/env: remove RunsInDocker during startup log (#4499)
Browse files Browse the repository at this point in the history
Remove the call to RunsInDocker on application start up and remove the
corresponding log line, "In docker: <bool>".
As the implementation of this check is Linux-specific, it would always
error on non-Linux platforms and exit the program. Because the
usefulness of this log line is questionable, it was removed entirely
instead of fixing the problem by e.g. only logging this when running on
Linux.
  • Loading branch information
JordiSubira committed Apr 11, 2024
1 parent 594cc03 commit f9c9639
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions private/env/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"os"

"github.com/scionproto/scion/pkg/log"
"github.com/scionproto/scion/pkg/private/serrors"
)

// Startup* variables are set during link time.
Expand All @@ -31,16 +30,11 @@ var (
// LogAppStarted should be called by applications as soon as logging is
// initialized.
func LogAppStarted(svcType, elemID string) error {
inDocker, err := RunsInDocker()
if err != nil {
return serrors.WrapStr("Unable to determine if running in docker", err)
}
info := fmt.Sprintf("=====================> Service started %s %s\n"+
"%s %s\n %s\n %s\n %s\n",
"%s\n %s\n %s\n %s\n",
svcType,
elemID,
VersionInfo(),
fmt.Sprintf("In docker: %v", inDocker),
fmt.Sprintf("pid: %d", os.Getpid()),
fmt.Sprintf("euid/egid: %d %d", os.Geteuid(), os.Getegid()),
fmt.Sprintf("cmd line: %q", os.Args),
Expand Down

0 comments on commit f9c9639

Please sign in to comment.