Examples of LogHandler


Examples of ch.njol.skript.log.LogHandler

       
        if (logNormal())
          info("Loading variables...");
        final long vls = System.currentTimeMillis();
       
        final LogHandler h = SkriptLogger.startLogHandler(new ErrorDescLogHandler() {
          private final List<LogEntry> log = new ArrayList<LogEntry>();
         
          @Override
          public LogResult log(final LogEntry entry) {
            super.log(entry);
            if (entry.level.intValue() >= Level.SEVERE.intValue()) {
              logEx(entry.message); // no [Skript] prefix
              return LogResult.DONT_LOG;
            } else {
              log.add(entry);
              return LogResult.CACHED;
            }
          }
         
          @Override
          protected void beforeErrors() {
            logEx();
            logEx("===!!!=== Skript variable load error ===!!!===");
            logEx("Unable to load (all) variables:");
          }
         
          @Override
          protected void afterErrors() {
            logEx();
            logEx("Skript will work properly, but old variables might not be available at all and new ones may or may not be saved until Skript is able to create a backup of the old file and/or is able to connect to the database (which requires a restart of Skript)!");
            logEx();
          }
         
          @Override
          protected void onStop() {
            super.onStop();
            SkriptLogger.logAll(log);
          }
        });
        final CountingLogHandler c = SkriptLogger.startLogHandler(new CountingLogHandler(SkriptLogger.SEVERE));
        try {
          if (!Variables.load())
            if (c.getCount() == 0)
              error("(no information available)");
        } finally {
          c.stop();
          h.stop();
        }
       
        final long vld = System.currentTimeMillis() - vls;
        if (logNormal())
          info("Loaded " + Variables.numVariables() + " variables in " + ((vld / 100) / 10.) + " seconds");
View Full Code Here

Examples of ch.njol.skript.log.LogHandler

  @SuppressWarnings("unchecked")
  @Override
  public boolean isLoopOf(final String s) {
    if (!(types instanceof Literal<?>))
      return false;
    final LogHandler h = SkriptLogger.startLogHandler(new BlockingLogHandler());
    try {
      final EntityData<?> d = EntityData.parseWithoutIndefiniteArticle(s);
      if (d != null) {
        for (final EntityData<?> t : ((Literal<EntityData<?>>) types).getAll()) {
          assert t != null;
          if (!d.isSupertypeOf(t))
            return false;
        }
        return true;
      }
    } finally {
      h.stop();
    }
    return false;
  }
View Full Code Here

Examples of com.github.theholywaffle.teamspeak3.log.LogHandler

    }
  }

  public TS3Query(TS3Config config) {
    log.setUseParentHandlers(false);
    log.addHandler(new LogHandler(config.getDebugToFile()));
    log.setLevel(config.getDebugLevel());
    this.config = config;
  }
View Full Code Here

Examples of com.google.gwt.libideas.logging.shared.LogHandler

  }

  public void log(Level level, String msg, String category, Throwable e) {
    if (isLoggable(level, category)) {
      for (int i = 0; i < handlers.size(); i++) {
        LogHandler handler = (LogHandler) handlers.get(i);
        if (allows(handler.getLevel(), level)) {
          handler.publish(msg, level, category, e);
        }
      }
    }
  }
View Full Code Here

Examples of com.subgraph.vega.application.logging.LogHandler

  private void setupLogging() {
    Logger rootLogger = Logger.getLogger("");

    IConsole console = Activator.getDefault().getConsole();
    if(console != null) {
      Handler handler = new LogHandler(console);
      handler.setFormatter(new LogFormatter());
      handler.setLevel(Level.FINEST);
      for(Handler h: rootLogger.getHandlers())
        rootLogger.removeHandler(h);
      rootLogger.addHandler(handler);
    }
   
View Full Code Here

Examples of org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.LogHandler

    addService(dispatcher);
  }

  @Override
  public void serviceInit(Configuration conf) throws Exception {
    LogHandler logHandler =
      createLogHandler(conf, this.context, this.deletionService);
    addIfService(logHandler);
    dispatcher.register(LogHandlerEventType.class, logHandler);
   
    super.serviceInit(conf);
View Full Code Here

Examples of org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.LogHandler

    this.writeLock = lock.writeLock();
  }

  @Override
  public void serviceInit(Configuration conf) throws Exception {
    LogHandler logHandler =
      createLogHandler(conf, this.context, this.deletionService);
    addIfService(logHandler);
    dispatcher.register(LogHandlerEventType.class, logHandler);
   
    waitForContainersOnShutdownMillis =
View Full Code Here

Examples of org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.LogHandler

  }

  @Override
  protected LogHandler createLogHandler(Configuration conf,
      Context context, DeletionService deletionService) {
    return new LogHandler() {
     
      @Override
      public void handle(LogHandlerEvent event) {
        switch (event.getType()) {
          case APPLICATION_STARTED:
View Full Code Here

Examples of org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.LogHandler

    addService(dispatcher);
  }

  @Override
  public void init(Configuration conf) {
    LogHandler logHandler =
      createLogHandler(conf, this.context, this.deletionService);
    addIfService(logHandler);
    dispatcher.register(LogHandlerEventType.class, logHandler);
   
    super.init(conf);
View Full Code Here

Examples of org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.LogHandler

    this.writeLock = lock.writeLock();
  }

  @Override
  public void serviceInit(Configuration conf) throws Exception {
    LogHandler logHandler =
      createLogHandler(conf, this.context, this.deletionService);
    addIfService(logHandler);
    dispatcher.register(LogHandlerEventType.class, logHandler);
   
    waitForContainersOnShutdownMillis =
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.