fix(inspector): print the startup URL

This commit is contained in:
imccyu
2026-08-27 16:16:28 +08:00
parent d6245fc254
commit 777489dfc5
2 changed files with 3 additions and 2 deletions
@@ -49,7 +49,8 @@ export async function apply(ctx: Context, config: HostPluginConfig): Promise<voi
disposers.push(ctx.on('webserver/index-inject', (table: IndexInjection[]) => {
table.push({ kind: 'global', name: '__DSH_INSPECTOR__', value: handle.endpoint.client })
}))
ctx.logger.info(`dsh inspector: ${handle.endpoint.devtoolsFrontendUrl}`)
// This readiness URL is emitted while the plugin tree is still loading, before a logger sink is guaranteed.
console.log(`dsh inspector: ${handle.endpoint.devtoolsFrontendUrl}`)
} catch (error) {
await disposeInspector(handle, disposers).catch((cleanupError: unknown) => {
ctx.logger.error('experimental-inspector: initialization rollback failed', cleanupError)
@@ -23,7 +23,7 @@ describe('experimental Inspector Host plugin', () => {
it('starts the Worker, provides ctx.inspector, injects Client bootstrap, and disposes', async () => {
context = new Context()
const log = vi.spyOn(context.logger, 'info').mockImplementation(() => undefined)
const log = vi.spyOn(console, 'log').mockImplementation(() => undefined)
context.provide('webServer', {} as WebServer)
const fiber = context.plugin(
{ name, inject: [...inject], Config, apply },