stubLogger defaults to using the global sinon instance when no sandbox is passed, and it stubs the static Logger.create method. If this helper is ever called without a sandbox (or without a corresponding global restore), it can leak the stub across tests and create ordering-dependent failures. Consider requiring a SinonSandbox parameter (no fallback) so callers always get automatic cleanup via sandbox.restore().
Originally posted by @Copilot in #21708 (comment)
stubLogger defaults to using the global sinon instance when no sandbox is passed, and it stubs the static Logger.create method. If this helper is ever called without a sandbox (or without a corresponding global restore), it can leak the stub across tests and create ordering-dependent failures. Consider requiring a SinonSandbox parameter (no fallback) so callers always get automatic cleanup via sandbox.restore().
Originally posted by @Copilot in #21708 (comment)