Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.8k views
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 OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...