console.debug()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

console.debug() メソッドは、メッセージを "debug" ログレベルでウェブコンソールに出力します。このメッセージは、デバッグ出力を表示するようにコンソールが構成されている場合にのみユーザーに表示されます。多くの場合、ログレベルはコンソールの UI の中で構成します。このログレベルは `Debug` または `Verbose` ログレベルに相当します。

メモ: この機能はウェブワーカー内で利用可能です。

構文

js
debug(obj1);
debug(obj1, /* …, */ objN);
debug(msg);
debug(msg, subst1, /* …, */ substN);

引数

obj1objN

出力する JavaScript オブジェクトのリスト。これらの各オブジェクトの文字列表現は、リストされた順に追加され、コンソールに出力されます。

msg

連続した順序で subst1 から substN に置き換えられる 0 個以上の置換文字列を含む JavaScript 文字列です。

subst1substN

msg 内の置換文字列を置換する JavaScript オブジェクト。これにより、出力の形式をさらに制御できます。置換のしくみの説明については、 console文字列置換の使用を参照してください。

詳細については、console オブジェクトのドキュメントのコンソールへのテキストの出力を参照してください。

返値

なし (undefined)。

仕様書

Specification
Console
# debug

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
debug() static method

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
See implementation notes.