2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

JavaScript コンソールのレヴェルの扱いの違い

Last updated at Posted at 2022-08-01

JavaScript コンソール (console.log() など) は事実上の標準化が為されていますが,エラーレヴェルの扱いについては違いがあります。以下に表を示します。

Firefox

Level 説明 デフォルトで表示 特記事項
debug console.debug() no アイコン無し
log console.log() yes アイコン無し
info console.info() yes
warn console.warn() yes
error console.error() yes

Chrome

Level 説明 デフォルトで表示 特記事項
debug console.debug() no アイコン無し
info console.log(), console.info() yes アイコン無し
warn console.warn() yes
error console.error() yes

Safari

Level 説明 デフォルトで表示 特記事項
debug console.debug() yes breakpoint アイコン
log console.log() yes log アイコン
info console.info() yes info アイコン
warn console.warn() yes warn アイコン
error console.error() yes error アイコン

ただし,Safari ではこれらのログが All,Errors,Warnings,Logs の3段階でフィルタ可能です。それぞれのフィルタレヴェルで表示されるログは以下の通りです:

フィルタレヴェル 表示されるログ
All error, warn, info, log, debug
Errors error
Warnings warn
Logs info, log, debug

Safari ではこの他にも, Evaluations (コンソールに入力した式の評価結果) もフィルタ可能です。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?