Examples of ConsoleHandler


Examples of com.oracle.truffle.r.runtime.RContext.ConsoleHandler

            return RNull.instance;
        }

        @SlowPath
        private static void doBrowser(MaterializedFrame frame) {
            ConsoleHandler ch = RContext.getInstance().getConsoleHandler();
            REnvironment callerEnv = REnvironment.frameToEnvironment(frame.materialize());
            ch.printf("Called from: %s%n", callerEnv == REnvironment.globalEnv() ? "top level" : RArguments.getFunction(frame).getTarget());
            String savedPrompt = ch.getPrompt();
            ch.setPrompt(browserPrompt());
            try {
                LW: while (true) {
                    String input = ch.readLine();
                    if (input.length() == 0) {
                        RLogicalVector browserNLdisabledVec = (RLogicalVector) ROptions.getValue("browserNLdisabled");
                        if (!RRuntime.fromLogical(browserNLdisabledVec.getDataAt(0))) {
                            break;
                        }
                    } else {
                        input = input.trim();
                    }
                    switch (input) {
                        case "c":
                        case "cont":
                            break LW;

                        case "s":
                        case "f":
                        case "n":
                            throw RError.nyi(null, notImplemented(input));

                        case "where": {
                            int ix = RArguments.getDepth(frame);
                            Frame stackFrame;
                            while (ix >= 0 && (stackFrame = Utils.getStackFrame(FrameAccess.READ_ONLY, ix)) != null) {
                                RFunction fun = RArguments.getFunction(stackFrame);
                                if (fun != null) {
                                    ch.printf("where %d: %s%n", ix, fun.getTarget());
                                }
                                ix--;
                            }
                            ch.println("");
                            break;
                        }

                        default:
                            RContext.getEngine().parseAndEval("<browser_input>", input, frame.materialize(), callerEnv, true, false);
                            break;
                    }
                }
            } finally {
                ch.setPrompt(savedPrompt);
            }
        }
View Full Code Here

Examples of com.subgraph.vega.application.console.ConsoleHandler

      return IApplication.EXIT_OK;
    }
    if(!setupWorkspace()) {
      return IApplication.EXIT_OK;
    }
    ConsoleHandler consoleHandler = new ConsoleHandler(display, Activator.getDefault().getConsole());
    consoleHandler.activate();
   
    try {
      int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
      if (returnCode == PlatformUI.RETURN_RESTART)
        return IApplication.EXIT_RESTART;
View Full Code Here

Examples of eu.bges.log.ConsoleHandler

        final Exception exception = new Exception(exceptionMsg);
        final String logMsg = "something's gone wrong";
        final LogRecord record = LogTestUtil
                .createSevereRecordMsgWithException(logMsg, exception,
                        getClass(), thisMethodsName);
        new ConsoleHandler().publish(record);
        final String errMsg = errLog.getLog();
        final boolean containsExceptionMsg = errMsg.contains(exceptionMsg);
        assertTrue(
                "The exception message should be printed to the standard error stream",
                containsExceptionMsg);
View Full Code Here

Examples of java.util.logging.ConsoleHandler

            System.err.println("Invalid paremeters to log in "+loggingOut);
          }
        }
      }
      if(outHandlerList.size() == 0){
          outHandlerList.add(new ConsoleHandler());
      }
      configureLevels();
    }
  }
View Full Code Here

Examples of java.util.logging.ConsoleHandler

          System.err.println("Invalid paremeters to log in "+loggingOut);
        }
      }
    }
    if(outHandlerList.size() == 0){
        outHandlerList.add(new ConsoleHandler());
    }
    String loggingFormat = getString("loggings.format", "java.util.logging.XMLFormatter");
    Formatter format=null;
    try {
      Class c = Class.forName(loggingFormat);
View Full Code Here

Examples of java.util.logging.ConsoleHandler

        LogManager logManager = LogManager.getLogManager();
        logManager.reset();
        /* set the log level on the root logger */
        Logger rootLogger = Logger.getLogger("");
        rootLogger.setLevel(command.getLogLevel());
        ConsoleHandler consoleHandler = new ConsoleHandler();
        consoleHandler.setLevel(command.getLogLevel());
        rootLogger.addHandler(consoleHandler);

        logger.fine("Log level=" + command.getLogLevel());
    }
View Full Code Here

Examples of java.util.logging.ConsoleHandler

   * Should be only called once
   */
  public static void turnOnFileLogging() {
    logger.setLevel(java.util.logging.Level.ALL);
    java.util.logging.Handler handler;
    handler = new ConsoleHandler();
    logger.addHandler(handler);

    handler.setFilter(new Filter() { // select what gets logged
        public boolean isLoggable(LogRecord record) {
          return true;
View Full Code Here

Examples of java.util.logging.ConsoleHandler

 
  public static void setLogLevel(String namespace, Level level) {
    Logger logger = Logger.getLogger(namespace);
    logger.setLevel(level);

    ConsoleHandler ch = new ConsoleHandler();
    ch.setLevel(level);
    ch.setFormatter(new LogFormatter());
    logger.addHandler(ch);   
  }
View Full Code Here

Examples of java.util.logging.ConsoleHandler

  private static Logger ourLogger = Logger.getLogger("org.ganttproject");
  private static Handler ourHandler;
  private static UIFacade ourUIFacade;

  public static void setup() {
        ourHandler = new ConsoleHandler();
    ourLogger.addHandler(ourHandler);
    ourLogger.setLevel(Level.ALL);
    ourHandler.setFormatter(new java.util.logging.SimpleFormatter());
  }
View Full Code Here

Examples of java.util.logging.ConsoleHandler

 
  public static void setLogLevel(String namespace, Level level) {
    Logger logger = Logger.getLogger(namespace);
    logger.setLevel(level);

    ConsoleHandler ch = new ConsoleHandler();
    ch.setLevel(level);
    ch.setFormatter(new LogFormatter());
    logger.addHandler(ch);   
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.