Skip to content

Commit 6b48684

Browse files
committed
refactor: use structured logging for python env
1 parent 2c92bf1 commit 6b48684

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/core/control_panel/launcher_local.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func (c *ControlPanel) LaunchLocalPlugin(
7171
// expire: generous upper bound for env initialization; tryLockTimeout: wait up to the same duration
7272
expire := 15 * time.Minute
7373
tryTimeout := 2 * time.Minute
74-
log.Info("acquiring distributed init lock, plugin", pluginUniqueIdentifier.String(), "expire", expire.String())
74+
log.Info("acquiring distributed init lock", "plugin", pluginUniqueIdentifier.String(), "expire", expire.String())
7575
if err := cache.Lock(lockKey, expire, tryTimeout); err != nil {
7676
// failed to acquire the lock within timeout
7777
err = errors.Join(err, fmt.Errorf("failed to acquire distributed env-init lock"))
@@ -84,9 +84,9 @@ func (c *ControlPanel) LaunchLocalPlugin(
8484
}
8585
defer func() {
8686
if unlockErr := cache.Unlock(lockKey); unlockErr != nil {
87-
log.Warn("failed to release distributed init lock", pluginUniqueIdentifier.String(), "error", unlockErr.Error())
87+
log.Warn("failed to release distributed init lock", "plugin", pluginUniqueIdentifier.String(), "error", unlockErr.Error())
8888
} else {
89-
log.Info("released distributed init lock", pluginUniqueIdentifier.String())
89+
log.Info("released distributed init lock", "plugin", pluginUniqueIdentifier.String())
9090
}
9191
}()
9292

internal/core/local_runtime/setup_python_environment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ func (p *LocalPluginRuntime) deleteVirtualEnvironment() error {
284284
}
285285
return err
286286
}
287-
log.Warn("deleting existing Python virtual environment for %s at %s", p.Config.Identity(), venvDir)
287+
log.Warn("deleting existing Python virtual environment", "plugin", p.Config.Identity(), "path", venvDir)
288288
return os.RemoveAll(venvDir)
289289
}
290290

0 commit comments

Comments
 (0)