jcm
jcm

Reputation: 5659

How to do Javascript debug logging

I am writing an Angular app, with bit and pieces of JQuery plugins around the place.

Some of the logic is pretty complex and I'd like to have some debug logging that I can leave in the codebase that won't print out to the console in production.

What are people using to achieve this these days? I know Angular has its own logging but this logging needs to be across both the Angular stuff and the JQuery stuff. I can't rewrite the JQuery to be 'angularised'.

How can I best achieve this?

Upvotes: 1

Views: 76

Answers (2)

emcanes
emcanes

Reputation: 1398

Definitely breakpoints but you also need to check out

Batarang - chrome extension developed by angular team. I find it extremely useful for scope inheritance. It does crash now and then but it is still quite useful.

Upvotes: 1

Tyler.z.yang
Tyler.z.yang

Reputation: 2450

Maybe you can try chrome develop tools?

WIN: ctrl+shift+j

MAC: command+shift+j.

sources - > your script - > double click to add a breakpoint -> refresh

Here is a shortcut.

Upvotes: 1

Related Questions