File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Server-Side Components/Script Includes/Developer Debug Utility Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ var DeveloperDebugUtility = Class . create ( ) ;
2+ DeveloperDebugUtility . prototype = {
3+ initialize : function ( ) { } ,
4+
5+ // Checks if debug logging is enabled via system property
6+
7+ _enable_debug : function ( ) {
8+ // System Property: enable_debug_for_scripts (true/false)
9+ return gs . getProperty ( 'enable_debug_for_scripts' ) == 'true' ;
10+ } ,
11+
12+ // Controlled debug logger
13+ // {String} message - The message to log
14+ _debug : function ( message ) {
15+ if ( this . _enable_debug ( ) ) {
16+ gs . info ( '[DEBUG LOG] ' + message ) ;
17+ }
18+ } ,
19+
20+ // Example function where controlled debugging can be used
21+ addFunction : function ( data ) {
22+ try {
23+ // Example logic: simulate some operation
24+ this . _debug ( 'Executing addFunction with data: ' + JSON . stringify ( data ) ) ;
25+
26+ // core logic here
27+
28+ this . _debug ( 'addFunction executed successfully.' ) ;
29+ } catch ( e ) {
30+ this . _debug ( 'Error executing addFunction:\n' + e ) ;
31+ }
32+ } ,
33+
34+ type : 'DeveloperDebugUtility'
35+ } ;
You can’t perform that action at this time.
0 commit comments