Package org.apache.log4j

Examples of org.apache.log4j.Priority


                pw.print(callFrame);
            }
            pw.close();
            String stackTrace = sw.getBuffer().toString();
            Level level = this.getLevel(traceLevel);
            Priority priority = this.getLogPriority();
            if ( level.isGreaterOrEqual(priority)) {
                logger.log(level,stackTrace);
            }       
           
        }
View Full Code Here


     * Logger level setter.
     *
     * @param loggerLevel New logger level
     */
    public void setLoggerLevel(String channel, int loggerLevel) {
        Priority priority = toPriority(loggerLevel);
        Category cat = getCategory(channel);
        cat.setPriority(priority);
    }
View Full Code Here

   
    /**
     * Convert Slide priority to log4j priority.
     */
    protected Priority toPriority(int priority) {
        Priority result = null;
       
        switch (priority) {
        case EMERGENCY:
            result = Priority.FATAL;
            break;
View Full Code Here

   public static Priority toPriority(String name, Priority defaultPriority)
   {
      if( name == null )
         return TRACE;
     
      Priority p = TRACE;
      if( name.charAt(0) != 'T' )
         p = Priority.toPriority(name, defaultPriority);
      return p;
   }
View Full Code Here

    * fails, then this method returns the specified default.
    * @return the Priority object for i if one exists, defaultPriority otherwize.
    */
   public static Priority toPriority(int i, Priority defaultPriority)
   {
      Priority p;
      if( i == TRACE_INT )
         p = TRACE;
      else
         p = Priority.toPriority(i);
      return p;
View Full Code Here

    category.log(Priority.toPriority(level), message);
  }

  public final boolean isEnabled(int level)
  {
    Priority p = Priority.toPriority(level);
    if (category.isEnabledFor(p) == false)
      return false;
    return p.isGreaterOrEqual(category.getChainedPriority());
  }
View Full Code Here

    category.fatal(message, throwable);
  }

  public final boolean isFatalEnabled()
  {
    Priority p = Priority.FATAL;
    if (category.isEnabledFor(p) == false)
      return false;
    return p.isGreaterOrEqual(category.getChainedPriority());
  }
View Full Code Here

    category.error(message, throwable);
  }

  public final boolean isErrorEnabled()
  {
    Priority p = Priority.ERROR;
    if (category.isEnabledFor(p) == false)
      return false;
    return p.isGreaterOrEqual(category.getChainedPriority());
  }
View Full Code Here

    category.warn(message, throwable);
  }

  public final boolean isWarnEnabled()
  {
    Priority p = Priority.WARN;
    if (category.isEnabledFor(p) == false)
      return false;
    return p.isGreaterOrEqual(category.getChainedPriority());
  }
View Full Code Here

    category.info(message, throwable);
  }

  public final boolean isInfoEnabled()
  {
    Priority p = Priority.INFO;
    if (category.isEnabledFor(p) == false)
      return false;
    return p.isGreaterOrEqual(category.getChainedPriority());
  }
View Full Code Here

TOP

Related Classes of org.apache.log4j.Priority

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.