Wrapper around log4j.

@param level net.spy.compat.log.Level level.
@param message object message
@param e optional throwable
434154
@Override
  public void log(Level level, Object message, Throwable e) {
    org.apache.log4j.Level pLevel = org.apache.log4j.Level.DEBUG;

    switch (level == null ? Level.FATAL : level) {
    case TRACE:
      pLevel = org.apache.log4j.Level.TRACE;
      break;
    case DEBUG:
      pLevel = org.apache.log4j.Level.DEBUG;
      break;
    case INFO:
      pLevel = org.apache.log4j.Level.INFO;
      break;
    case WARN:
      pLevel = org.apache.log4j.Level.WARN;
      break;
    case ERROR:
      pLevel = org.apache.log4j.Level.ERROR;
      break;
    case FATAL:
      pLevel = org.apache.log4j.Level.FATAL;
      break;
    default:
      // I don't know what this is, so consider it fatal
      pLevel = org.apache.log4j.Level.FATAL;
      l4jLogger.log("net.spy.compat.log.AbstractLogger", pLevel, "Unhandled "
          + "log level:  " + level + " for the following message", null);
    }
    l4jLogger.log("net.spy.compat.log.AbstractLogger", pLevel, message, e);
  }
190946
public static void log(Logger logger,
                           Level level,
                           String message) {
        log(logger, level, message, NO_PARAMETERS);
    }
1339241
public void e(String format, Object... args) {
    println(LogLevel.ERROR, format, args);
  }
373063
protected String formatLogMessage(LogLevel level,Object[] message,Throwable throwable)
    {
        //get text
        String messageText=this.format(message);
        String throwableText=this.format(throwable);
        
        //init buffer
        StringBuilder buffer=new StringBuilder();

        //append prefix
        buffer.append("[fax4j][");
        buffer.append(level.getName());
        buffer.append("] ");
        
        if(messageText!=null)
        {
            buffer.append(messageText);
            
            if(throwableText!=null)
            {
                buffer.append(Logger.SYSTEM_EOL);
                buffer.append(throwableText);
            }
        }
        else if(throwableText!=null)
        {
            buffer.append(throwableText);
        }
        
        //get text
        String text=buffer.toString();
    
        return text;
    }
808181
public static void logException(String message, Exception e) {
    logger.log(Level.SEVERE, message, e);
  }
397641
@Override
    protected void logImpl(LogLevel level,Object[] message,Throwable throwable)
    {
        //get log level
        int levelValue=level.getValue();
        Level jdkLevel=null;
        switch(levelValue)
        {
            case LogLevel.DEBUG_LOG_LEVEL_VALUE:
                jdkLevel=Level.FINEST;
                break;
            case LogLevel.ERROR_LOG_LEVEL_VALUE:
                jdkLevel=Level.SEVERE;
                break;
            case LogLevel.INFO_LOG_LEVEL_VALUE:
            default:
                jdkLevel=Level.FINE;
                break;
        }

        if(jdkLevel!=null)
        {
            //format log message (without exception)
            String text=this.formatLogMessage(level,message,null);

            //log
            this.JDK_LOGGER.log(jdkLevel,text,throwable);
        }
    }
907327
public void veryverbose(CharSequence message, Throwable e) {
    log(Level.VERYVERBOSE, message, e);
  }
727094
public static void queueMessage(final String level, final String message) {
		try {
			LogAppender<LogEvent> appender = LogManager.getAppender();

			if (appender != null) {
				LogEvent.Builder builder = LogEvent.newBuilder();
				builder.level(level);
				builder.message(message);
				
				if ((level != null) && ("ERROR".equals(level.toUpperCase()))) {
					StackTraceElement[] stackTrace = new Throwable().getStackTrace();

					if ((stackTrace != null) && (1 < stackTrace.length)) {
						StackTraceElement caller = stackTrace[1];
						builder.className(caller.getClassName());
						builder.methodName(caller.getMethodName());
						builder.lineNumber(caller.getLineNumber());						
					}
				}
				
				appender.append(builder.build());
			}
		} catch (Throwable t) {
			LOGGER.info("Unable to queue message to Stackify Log API service: {} {}", level, message, t);
		}
	}
242905
public void trace(Object message, Throwable exception) {
        log(Level.FINEST, String.valueOf(message), exception);
    }
146230
private void execute(final Level level, final Object message, final Throwable t) {
        if (!m_logger.isEnabledFor(level)) return;

        if (m_asynchLoggerPool == null) {
            m_logger.log(level, message, t);
            return;
        }

        final Runnable runnableLoggingTask = createRunnableLoggingTask(level, message, t);
        try {
            m_asynchLoggerPool.execute(runnableLoggingTask);
        } catch (RejectedExecutionException e) {
            m_logger.log(Level.DEBUG, "Failed to execute logging task. Running in-line", e);
            runnableLoggingTask.run();
        }
    }
1077728
@Override
	public void log(Level level, String msg, Throwable thrown) {
		
		super.log(level, maskPassword(msg), thrown);
	}
365776
private void log(int level, String message, Throwable t) {
        if (!isLevelEnabled(level)) {
            return;
        }

        StringBuilder buf = new StringBuilder(32);

        // Append date-time if so configured
        if (CONFIG_PARAMS.showDateTime) {
            if (CONFIG_PARAMS.dateFormatter != null) {
                buf.append(getFormattedDate());
                buf.append(' ');
            } else {
                buf.append(System.currentTimeMillis() - START_TIME);
                buf.append(' ');
            }
        }

        // Append current thread name if so configured
        if (CONFIG_PARAMS.showThreadName) {
            buf.append('[');
            buf.append(Thread.currentThread().getName());
            buf.append("] ");
        }

        if (CONFIG_PARAMS.levelInBrackets)
            buf.append('[');

        // Append a readable representation of the log level
        String levelStr = renderLevel(level);
        buf.append(levelStr);
        if (CONFIG_PARAMS.levelInBrackets)
            buf.append(']');
        buf.append(' ');

        // Append the name of the log instance if so configured
        if (CONFIG_PARAMS.showShortLogName) {
            if (shortLogName == null)
                shortLogName = computeShortName();
            buf.append(String.valueOf(shortLogName)).append(" - ");
        } else if (CONFIG_PARAMS.showLogName) {
            buf.append(String.valueOf(name)).append(" - ");
        }

        // Append the message
        buf.append(message);

        write(buf, t);

    }
1079130
public void log(String message, Map<String, Object> custom, Level level) {
    log(null, custom, message, level);
  }
487402
public void info(Object message, Throwable exception) {
        log(Level.INFO, String.valueOf(message), exception);
    }
1291334
public void verbose(CharSequence message, Throwable e) {
    log(Level.INFO, message, e);
  }
698918
public void error(Object message, Throwable exception) {
    log(Level.ERROR, message, exception);
  }
880808
@Override
    protected void logImpl(LogLevel level,Object[] message,Throwable throwable)
    {
        //format log message (without exception)
        String text=this.formatLogMessage(level,message,null);

        //get log level
        int levelValue=level.getValue();
        switch(levelValue)
        {
            case LogLevel.DEBUG_LOG_LEVEL_VALUE:
                this.APACHE_LOGGER.debug(text);
                break;
            case LogLevel.ERROR_LOG_LEVEL_VALUE:
                this.APACHE_LOGGER.error(text,throwable);
                break;
            case LogLevel.INFO_LOG_LEVEL_VALUE:
            default:
                this.APACHE_LOGGER.info(text);
                break;
        }
    }