what is the difference between gs.print and gs.debug? and when we can use this ?

Rajesh98
ServiceNow Employee
ServiceNow Employee

what is the difference between gs.print and gs.debug? and when we can use this ?

1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

Hi there,

gs.print / gs.log is old and not scope proof. Use gs.info / gs.error / gs.warn / gs.debug instead.

Here's an image which might help:
find_real_file.png

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

2 REPLIES 2

Apeksha Joshi
Kilo Guru

Hi Rajesh ,

gs.debug () :

Logs informational events that are useful for debugging an application. Setting the log level for an application to debug generates info, warn, error, and debug messages.

 

gs.print():

Logs informational messages that describe the progress of the application. Setting the log level for an application to info generates info, warn, and error messages, but does not generate debug messages.

gs.print() will write an entry to the Log File, writes a message to system log only.

gs.print() takes 1 argument, message.

 

 

If my reply helps you at all, I’d really appreciate it if you click the Helpful button and if my reply is the answer you were looking for, it would be awesome if you could click both the Helpful and Accepted Solution buttons! 

 

Regards,

Apeksha

Mark Roethof
Tera Patron
Tera Patron

Hi there,

gs.print / gs.log is old and not scope proof. Use gs.info / gs.error / gs.warn / gs.debug instead.

Here's an image which might help:
find_real_file.png

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn