Improved Front-End Logging for ScriptRunner Behaviours

Note: This feature has been created as a result of SRJIRA-4594

What has changed? 

Prior to ScriptRunner v6.12.0, behaviours were logged to the user's browser console at a "WARN" level. 
From ScriptRunner v6.12.0 onwards, it's now possible to change the browser logging level to "DEBUG". 


Why is this useful?

This is useful for both ScriptRunner users and Adaptavist support staff alike because it reveals more information about how behaviours are interacting with a form. This information can be used alongside server logs to help resolve issues quicker. 


How to change the logging level

Changing the browser console debugging level is easy. Simply type the following into the browser console to change the logging level to DEBUG and WARN respectively: 

JBHV.setLogLevel('debug') | JBHV.setLogLevel('warn')

To filter your console to only show the ScriptRunner Behaviour logs, type "sr" into the console filter:  

You will have to reset the logging level to your preferred status manually. It will not happen on page refresh. 


Front-end logging vs. back-end logging

It's important to note that when you change the debugging level like this, it only affect the Behaviour logging which happens on the front-end (browser side). Doing this doesn't make any changes to the back-end logs which are found in the atlassian-jira.log file. Users will have to actively change the logging level back to WARN once they have finished troubleshooting their Behaviours because it doesn't reset automatically if the browser is closed or refreshed. 


Side effects

Setting the logging level to DEBUG may (but shouldn't) expose conditions or reduce browser performance.