Example #1
0
 /**
  * Creates a new debug scope that is unrelated to the current scope and runs a given task in the
  * new scope.
  *
  * @param name new scope name
  * @param context the context objects of the new scope
  * @param config the debug configuration to use for the new scope
  * @param runnable the task to run in the new scope
  */
 public static void sandbox(String name, Object[] context, DebugConfig config, Runnable runnable) {
   if (ENABLED) {
     DebugScope.getInstance().scope(name, runnable, null, true, config, context);
   } else {
     runnable.run();
   }
 }
Example #2
0
 public static void scope(String name, Object[] context, Runnable runnable) {
   if (ENABLED) {
     DebugScope.getInstance().scope(name, runnable, null, false, null, context);
   } else {
     runnable.run();
   }
 }