示例#1
0
文件: Debug.java 项目: rjsingh/graal
 public static <T> T scope(String name, Object[] context, Callable<T> callable) {
   if (ENABLED) {
     return DebugScope.getInstance().scope(name, null, callable, false, null, context);
   } else {
     return DebugScope.call(callable);
   }
 }
示例#2
0
文件: Debug.java 项目: rjsingh/graal
 /**
  * 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 callable the task to run in the new scope
  */
 public static <T> T sandbox(
     String name, Object[] context, DebugConfig config, Callable<T> callable) {
   if (ENABLED) {
     return DebugScope.getInstance().scope(name, null, callable, true, config, context);
   } else {
     return DebugScope.call(callable);
   }
 }
示例#3
0
文件: Debug.java 项目: rjsingh/graal
 /**
  * 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();
   }
 }
示例#4
0
文件: Debug.java 项目: rjsingh/graal
 public static Iterable<Object> context() {
   if (ENABLED) {
     return DebugScope.getInstance().getCurrentContext();
   } else {
     return Collections.emptyList();
   }
 }
示例#5
0
文件: Debug.java 项目: rjsingh/graal
 public static String currentScope() {
   if (ENABLED) {
     return DebugScope.getInstance().getQualifiedName();
   } else {
     return "";
   }
 }
示例#6
0
文件: Debug.java 项目: rjsingh/graal
 public static void scope(String name, Object[] context, Runnable runnable) {
   if (ENABLED) {
     DebugScope.getInstance().scope(name, runnable, null, false, null, context);
   } else {
     runnable.run();
   }
 }
示例#7
0
文件: Debug.java 项目: rjsingh/graal
 public static boolean isLogEnabled() {
   return ENABLED && DebugScope.getInstance().isLogEnabled();
 }
示例#8
0
文件: Debug.java 项目: rjsingh/graal
 public static void setConfig(DebugConfig config) {
   if (ENABLED) {
     DebugScope.getInstance().setConfig(config);
   }
 }
示例#9
0
文件: Debug.java 项目: rjsingh/graal
 public static void dump(Object object, String msg, Object... args) {
   if (ENABLED && DebugScope.getInstance().isDumpEnabled()) {
     DebugScope.getInstance().dump(object, msg, args);
   }
 }
示例#10
0
文件: Debug.java 项目: rjsingh/graal
 public static void printf(String msg, Object... args) {
   if (ENABLED && DebugScope.getInstance().isLogEnabled()) {
     DebugScope.getInstance().printf(msg, args);
   }
 }