Why the Client-side code should not contain the console.log() debugging method in service now(client scripts )? If possible please provide any document.

PTR
Tera Expert

Hi all,

I need  a small clarification like -  Why the Client-side code should not contain the console.log() debugging method in service now(client scripts )? Please provide the needful solution. 

 

1 ACCEPTED SOLUTION

Hi,

check this

Technical Best Practices

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

it could cause errors in certain browser versions and hence it is advised not to add that

As an alternative do this

Replace console.log() calls with jslog. The benefits of jslog are that you have to open the JavaScript Debugger Window to view the output, it is compatible with all browsers, and can be left in production since only administrators can open the window.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

PTR
Tera Expert

Thanks for providing useful info and please provide any knowledge article on this if possible.

Hi,

check this

Technical Best Practices

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader