INTEGRITY Cloudflare Docs

Console

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

All standard methods of the console API are present on the console 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:

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

Method Behavior
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