Skip to content

Commit

Permalink
Make module data dir and config reading logs debug level
Browse files Browse the repository at this point in the history
  • Loading branch information
benjirewis committed Nov 19, 2024
1 parent 79e7f99 commit 33a0596
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ require (
go.uber.org/zap v1.27.0
go.viam.com/api v0.1.357
go.viam.com/test v1.2.3
go.viam.com/utils v0.1.112
go.viam.com/utils v0.1.114
goji.io v2.0.2+incompatible
golang.org/x/image v0.19.0
golang.org/x/mobile v0.0.0-20240112133503-c713f31d574b
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1501,8 +1501,8 @@ go.viam.com/api v0.1.357 h1:L9LBYbaH0imv/B+mVxqtSgClIl4flzjLV6LclfnD9Nc=
go.viam.com/api v0.1.357/go.mod h1:5lpVRxMsKFCaahqsnJfPGwJ9baoQ6PIKQu3lxvy6Wtw=
go.viam.com/test v1.2.3 h1:tT2QqthC2BL2tiloUC2T1AIwuLILyMRx8mmxunN+cT4=
go.viam.com/test v1.2.3/go.mod h1:5pXMnEyvTygilOCaFtonnKNMqsCCBbe2ZXU8ZsJ2zjY=
go.viam.com/utils v0.1.112 h1:yuVkNITUijdP/CMI3BaDozUMZwP4Ari57BvRQfORFK0=
go.viam.com/utils v0.1.112/go.mod h1:SYvcY/TKy9yv1d95era4IEehImkXffWu/5diDBS/4X4=
go.viam.com/utils v0.1.114 h1:XT87y2ZFtgJSyJ2+MbU7PpOR793Zia/j8rptTGIqhZ8=
go.viam.com/utils v0.1.114/go.mod h1:khl/uKYhlrnBmE3CXXlWKDElwav3ya0SCvWlMNOiyp4=
go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2 h1:WJhcL4p+YeDxmZWg141nRm7XC8IDmhz7lk5GpadO1Sg=
go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E=
gocv.io/x/gocv v0.25.0/go.mod h1:Rar2PS6DV+T4FL+PM535EImD/h13hGVaHhnCu1xarBs=
Expand Down
4 changes: 2 additions & 2 deletions module/modmanager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions module/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
h.ServeHTTP(w, r)
}

// Stats is unsupported.
func (s *Server) Stats() any {
return nil
}

type httpHandler struct{}

// ServeHTTP returns only an error message.
Expand Down

0 comments on commit 33a0596

Please sign in to comment.