From 0a250a2327bdb33b870e7e66f73061ca432aadf9 Mon Sep 17 00:00:00 2001 From: Benji Rewis Date: Tue, 19 Nov 2024 12:05:47 -0500 Subject: [PATCH 1/2] Make module data dir and config reading logs debug level --- config/watcher.go | 2 +- module/modmanager/manager.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/watcher.go b/config/watcher.go index f3a6b502ef8..6dd78cb67e5 100644 --- a/config/watcher.go +++ b/config/watcher.go @@ -73,7 +73,7 @@ func newCloudWatcher(ctx context.Context, config *Config, logger logging.Logger) } newConfig, err := readFromCloud(cancelCtx, config, prevCfg, false, checkForNewCert, logger) if err != nil { - logger.Errorw("error reading cloud config", "error", err) + logger.Debugw("error reading cloud config; will try again", "error", err) continue } if cp, err := newConfig.CopyOnlyPublicFields(); err == nil { diff --git a/module/modmanager/manager.go b/module/modmanager/manager.go index 16d2fd3974f..c865171df61 100644 --- a/module/modmanager/manager.go +++ b/module/modmanager/manager.go @@ -348,7 +348,7 @@ func (mgr *Manager) startModule(ctx context.Context, mod *module) error { // create the module's data directory if mod.dataDir != "" { - mgr.logger.Infof("Creating data directory %q for module %q", mod.dataDir, mod.cfg.Name) + mgr.logger.Debugf("Creating data directory %q for module %q", mod.dataDir, mod.cfg.Name) if err := os.MkdirAll(mod.dataDir, 0o750); err != nil { return errors.WithMessage(err, "error while creating data directory for module "+mod.cfg.Name) } @@ -1121,7 +1121,7 @@ func (m *module) startProcess( moduleWorkingDirectory, ok := moduleEnvironment["VIAM_MODULE_ROOT"] if !ok { moduleWorkingDirectory = filepath.Dir(absoluteExePath) - logger.CWarnw(ctx, "VIAM_MODULE_ROOT was not passed to module. Defaulting to module's working directory", + logger.CDebugw(ctx, "VIAM_MODULE_ROOT was not passed to module. Defaulting to module's working directory", "module", m.cfg.Name, "dir", moduleWorkingDirectory) } else { logger.CInfow(ctx, "Starting module in working directory", "module", m.cfg.Name, "dir", moduleWorkingDirectory) From ba51d8633c184ff3ac72e2d39ed9dcb0614c0037 Mon Sep 17 00:00:00 2001 From: Benji Rewis Date: Thu, 21 Nov 2024 17:16:45 -0500 Subject: [PATCH 2/2] remove extraneous warning about config read failure --- config/reader.go | 1 - 1 file changed, 1 deletion(-) diff --git a/config/reader.go b/config/reader.go index 6b72d6a1bed..4e060321c2e 100644 --- a/config/reader.go +++ b/config/reader.go @@ -618,7 +618,6 @@ func getFromCloudOrCache(ctx context.Context, cloudCfg *Cloud, shouldReadFromCac cfg, errorShouldCheckCache, err := getFromCloudGRPC(ctxWithTimeout, cloudCfg, logger) if err != nil { if shouldReadFromCache && errorShouldCheckCache { - logger.Warnw("failed to read config from cloud, checking cache", "error", err) cachedConfig, cacheErr := readFromCache(cloudCfg.ID) if cacheErr != nil { if os.IsNotExist(cacheErr) {