Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Cloudflare Docs
Log in

Theconsole object provides a set of methods to help you emit logs, warnings, and debug code.

All standardmethods of theconsole API are present on theconsole object in Workers.

However, some methods are no ops — they can be called, and do not emit an error, but do not do anything. This ensures compatibility with libraries which may use these APIs.

The table below enumerates each method, and the extent to which it is supported in Workers.

All methods noted as "✅ supported" have the following behavior:

All methods noted as "🟡 partial support" have the following behavior:

  • In both production and local development the method can be safely called, but will do nothing (no op)
  • In theWorkers Playground, Quick Editor in the Workers dashboard, and remote preview mode (wrangler dev --remote) calling the method will behave as expected, print to the console, etc.

Refer toLog from Workers for more on debugging and adding logs to Workers.

MethodBehavior
console.debug()✅ supported
console.error()✅ supported
console.info()✅ supported
console.log()✅ supported
console.warn()✅ supported
console.clear()🟡 partial support
console.count()🟡 partial support
console.group()🟡 partial support
console.table()🟡 partial support
console.trace()🟡 partial support
console.assert()⚪ no op
console.countReset()⚪ no op
console.dir()⚪ no op
console.dirxml()⚪ no op
console.groupCollapsed()⚪ no op
console.groupEnd⚪ no op
console.profile()⚪ no op
console.profileEnd()⚪ no op
console.time()⚪ no op
console.timeEnd()⚪ no op
console.timeLog()⚪ no op
console.timeStamp()⚪ no op
console.createTask()🔴 Will throw an exception in production, but works in local dev, Quick Editor, and remote preview

[8]
ページ先頭

©2009-2026 Movatter.jp