Skip to content

Commit 8c8f74d

Browse files
authored
Make module data dir and config reading logs debug level (#4566)
1 parent baf6c50 commit 8c8f74d

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

config/reader.go

-1
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,6 @@ func getFromCloudOrCache(ctx context.Context, cloudCfg *Cloud, shouldReadFromCac
618618
cfg, errorShouldCheckCache, err := getFromCloudGRPC(ctxWithTimeout, cloudCfg, logger)
619619
if err != nil {
620620
if shouldReadFromCache && errorShouldCheckCache {
621-
logger.Warnw("failed to read config from cloud, checking cache", "error", err)
622621
cachedConfig, cacheErr := readFromCache(cloudCfg.ID)
623622
if cacheErr != nil {
624623
if os.IsNotExist(cacheErr) {

config/watcher.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func newCloudWatcher(ctx context.Context, config *Config, logger logging.Logger)
7373
}
7474
newConfig, err := readFromCloud(cancelCtx, config, prevCfg, false, checkForNewCert, logger)
7575
if err != nil {
76-
logger.Errorw("error reading cloud config", "error", err)
76+
logger.Debugw("error reading cloud config; will try again", "error", err)
7777
continue
7878
}
7979
if cp, err := newConfig.CopyOnlyPublicFields(); err == nil {

module/modmanager/manager.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ func (mgr *Manager) startModule(ctx context.Context, mod *module) error {
348348

349349
// create the module's data directory
350350
if mod.dataDir != "" {
351-
mgr.logger.Infof("Creating data directory %q for module %q", mod.dataDir, mod.cfg.Name)
351+
mgr.logger.Debugf("Creating data directory %q for module %q", mod.dataDir, mod.cfg.Name)
352352
if err := os.MkdirAll(mod.dataDir, 0o750); err != nil {
353353
return errors.WithMessage(err, "error while creating data directory for module "+mod.cfg.Name)
354354
}
@@ -1121,7 +1121,7 @@ func (m *module) startProcess(
11211121
moduleWorkingDirectory, ok := moduleEnvironment["VIAM_MODULE_ROOT"]
11221122
if !ok {
11231123
moduleWorkingDirectory = filepath.Dir(absoluteExePath)
1124-
logger.CWarnw(ctx, "VIAM_MODULE_ROOT was not passed to module. Defaulting to module's working directory",
1124+
logger.CDebugw(ctx, "VIAM_MODULE_ROOT was not passed to module. Defaulting to module's working directory",
11251125
"module", m.cfg.Name, "dir", moduleWorkingDirectory)
11261126
} else {
11271127
logger.CInfow(ctx, "Starting module in working directory", "module", m.cfg.Name, "dir", moduleWorkingDirectory)

0 commit comments

Comments
 (0)