Package org.objectweb.util.monolog.api

Examples of org.objectweb.util.monolog.api.Level


   * @return the Level instance or a null value.
   */
  private Level defineLevel(Level l) {
    String name = l.getName();
    int value = l.getIntValue();
    Level res = (Level) nameToLevel.get(name);
    if (res != null) {
      // The name is already defined.
      return (res.getIntValue() == value ? res : null);
    }
    else {
      res = l;
      nameToLevel.put(name, res);
      Integer i = new Integer(value);
View Full Code Here


    }
    return result;   
  }

  public void removeLevel(String name) {
    Level removed = (Level) nameToLevel.remove(name);
    if (removed != null) {
      Integer i = new Integer(removed.getIntValue());
      Object temp = intToNames.get(i);
      if (temp instanceof String) {
        intToNames.remove(i);
      }
      else if (temp instanceof Vector) {
View Full Code Here

   */
  private Level defineLevel(Level l) {
    //System.out.println("def(" + l + ") begin");
    String name = l.getName();
    int value = l.getIntValue();
    Level res = (Level) nameToLevel.get(name);
    if (res != null) {
      // The name is already defined.
      return (res.getIntValue() == value ? res : null);
    }
    else {
      res = l;
      nameToLevel.put(name, res);
      Integer i = new Integer(value);
View Full Code Here

  // IMPLEMENTATION OF THE LevelFactory INTERFACE //
  //-----------------------------------------------//

  public synchronized Level defineLevel(String name, int value) {
    Level l =  new LevelImpl(name, value);
    if (levels == null) {
      levels = new HashMap();
    }
    levels.put(new Integer(value), l);
    return l;
View Full Code Here

    levels.put(new Integer(value), l);
    return l;
  }

  public Level defineLevel(String name, String value) {
    Level l =  new LevelImpl(name, value, this);
    if (levels == null) {
      levels = new HashMap();
    }
    levels.put(new Integer(value), l);
    return l;
View Full Code Here

  }

  public Level getLevel(String name) {
    Iterator it = levels.values().iterator();
    while(it.hasNext()) {
      Level l = (Level) it.next();
      if (l.getName().equals(name)) {
        return l;
      }
    }
    return null;
  }
View Full Code Here

     */
    private Level defineLevel(Level l) {
        //System.out.println("def(" + l + ") begin");
        String name = l.getName();
        int value = l.getIntValue();
        Level res = (Level) nameToLevel.get(name);
        if (res != null) {
            // The name is already defined.
            return (res.getIntValue() == value ? res : null);
        } else {
            res = l;
            nameToLevel.put(name, res);
            Integer i = new Integer(value);
            Object temp = intToNames.get(i);
View Full Code Here

  }

  public synchronized void removeLevel(String name) {
    Iterator it = levels.values().iterator();
    while(it.hasNext()) {
      Level l = (Level) it.next();
      if (l.getName().equals(name)) {
        it.remove();
      }
    }
  }
View Full Code Here

  public Level[] getLevels() {
    return (Level[]) nameToLevel.values().toArray(new Level[0]);
  }

  public void removeLevel(String name) {
    Level removed = (Level) nameToLevel.remove(name);
    if (removed != null) {
      Integer i = new Integer(removed.getIntValue());
      Object temp = intToNames.get(i);
      if (temp instanceof String) {
        intToNames.remove(i);
      } else if (temp instanceof ArrayList) {
        ((ArrayList) temp).remove(name);
View Full Code Here

    debug("BasicLevel.DEBUG=" + BasicLevel.DEBUG);
    int debug1 = BasicLevel.DEBUG + 1;
    debug("debug1=" + debug1);
    int debug2 = BasicLevel.DEBUG + 2;
    debug("debug2=" + debug2);
    Level debug3 = lef.defineLevel("DEBUG3", BasicLevel.DEBUG + 3);
    debug("debug3=" +
      (debug3 != null ? "Level: " + debug3.getIntValue() : "null"));
    debug("BasicLevel.INFO=" + BasicLevel.INFO);
    debug("BasicLevel.WARN=" + BasicLevel.WARN);
    debug("BasicLevel.ERROR=" + BasicLevel.ERROR);
    debug("BasicLevel.FATAL=" + BasicLevel.FATAL);
View Full Code Here

TOP

Related Classes of org.objectweb.util.monolog.api.Level

Copyright © 2018 www.massapicom. 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.