Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSDK-9326 - log important viam env variables #4602

Merged
13 changes: 13 additions & 0 deletions web/server/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ type robotServer struct {
registry *logging.Registry
}

func logViamEnvVariables(logger logging.Logger) {
if value, exists := os.LookupEnv("VIAM_MODULE_ROOT"); exists {
logger.Info("VIAM_MODULE_ROOT is set to: ", value)
}
if value, exists := os.LookupEnv("VIAM_RESOURCE_CONFIGURATION_TIMEOUT"); exists {
logger.Info("VIAM_RESOURCE_CONFIGURATION_TIMEOUT is set to: ", value)
}
if value, exists := os.LookupEnv("VIAM_MODULE_STARTUP_TIMEOUT"); exists {
logger.Info("VIAM_MODULE_STARTUP_TIMEOUT is set to: ", value)
}
}

func logVersion(logger logging.Logger) {
var versionFields []interface{}
if config.Version != "" {
Expand All @@ -70,6 +82,7 @@ func logVersion(logger logging.Logger) {
} else {
logger.Info("Viam RDK built from source; version unknown")
}
logViamEnvVariables(logger)
}

// RunServer is an entry point to starting the web server that can be called by main in a code
Expand Down
Loading