Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others


0 votes
in Technique[技术] by (71.8m points)

logging - How to see the console log in PhpStorm when running Angular

I am running Angular in a PhpStorm IDE.

The code is fill with "console.log" calls, when console defined as declare var console: Console; Console in a interface in the lib.dom.d.ts library.

Anyway, I can't see this log anywhere! Where is the console window in PhpStorm?

Is there any simple way to define log in Angular? I saw something about ngx-logger library, but I didn't find any instructions of how to install this library.

Any help in angular log subject will be great!

Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

All logs from console.log you can see in browsers console (To open the developer console in Google Chrome, open the Chrome Menu in the upper-right-hand corner of the browser window and select More Tools > Developer Tools. You can also use the shortcut Option + ? + J (on macOS), or Shift + CTRL + J (on Windows/Linux).) Also you don't need to declare console, it's global variable.

All logs in your code will be runed in browser (in runtime). In IDE you can see only build time logs.

Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share