Private Logger function to handle Log calls

@param level     level of the log message
@param message   log output
@param throwable
165550
private static int logger(int level, String message, Throwable throwable) {

        if (QuickUtils.shouldShowLogs()) {
            switch (level) {

                case QuickUtils.DEBUG:
                    return android.util.Log.d(QuickUtils.TAG, message, throwable);
                case QuickUtils.VERBOSE:
                    return android.util.Log.v(QuickUtils.TAG, message, throwable);
                case QuickUtils.INFO:
                    return android.util.Log.i(QuickUtils.TAG, message, throwable);
                case QuickUtils.WARN:
                    return android.util.Log.w(QuickUtils.TAG, message, throwable);
                case QuickUtils.ERROR:
                    return android.util.Log.e(QuickUtils.TAG, message, throwable);
                default:
                    break;
            }
        }

        return -1;
    }
227287
private synchronized void logEvent( int level, String string, Throwable throwable )
    {
        // Check if the event should be logged
        if ( level > _loggingLevel )
        {
            return;
        }

        if ( _logFile != null )
        {
            // No logfile specified, log using servlet context
            PrintWriter pw = null;
            try
            {
                pw = new PrintWriter( new FileWriter( _logFile, true ) );
                pw.println( _servletName + "(" + level + "): " + string );
                if ( throwable != null )
                {
                    throwable.printStackTrace( pw );
                }
                pw.close();
                // Do a return here. An exception will cause a fall through to
                // do _servletContex logging API
                return;
            }
            catch ( IOException ioe )
            {
                /* just ignore */
            }
        }

        // Otherwise, write to servlet context log
        if ( throwable == null )
        {
            _servletContext.log( string );
        }
        else
        {
            _servletContext.log( string, throwable );
        }
    }
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);
        }
    }
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);
		}
	}
749561
public void log(SebContext context, Level level, String message) {
		triggerEvent(constructEvent(LogEvent.class, context).with(level, message));
	}
747936
public synchronized void logMessage(final Level level, final String message)
	{

		if (logLevel.toInt() > level.toInt()) {
			return;
		}

		try {
			this.writer.write(System.currentTimeMillis() + "\t" + consumerName
					+ " [" + type.toString() + "] " + "\t" + message + "\r\n");
			this.writer.flush();
		}
		catch (IOException ioe) {
			ioe.printStackTrace();
		}
	}
928822
void log(Level level, String msg) {
        if (msg != null && !msg.isEmpty())
            logger.log(level, msg);
    }
1183486
public void catching(Level level, Throwable throwable) {
        if (instanceofLAL) {
            ((LocationAwareLogger) logger).log(CATCHING_MARKER, FQCN, level.level, "catching", null, throwable);
        }
    }
929833
void log(Level level, String msg, Exception e) {
        if (e != null)
            logger.log(level, msg, e);
    }
190946
public static void log(Logger logger,
                           Level level,
                           String message) {
        log(logger, level, message, NO_PARAMETERS);
    }
699556
public void log(Level level, Throwable throwable, String msg, Object[] argArray) {
		logIfEnabled(level, throwable, msg, UNKNOWN_ARG, UNKNOWN_ARG, UNKNOWN_ARG, argArray);
	}
1292287
public void debug(Object message, Throwable t) {
        doLog(Level.DEBUG, FQCN, message, null, t);
    }
1367485
public static void log(Level level, String message) {
        Logger.getLogger("LEX4J").log(level, message);
    }
412792
public void debug(Object message, Throwable exception) {
        log(Level.FINE, String.valueOf(message), exception);
    }
812462
@Override
  public void logException(LogLevel logLevel, Throwable throwable, Class clazz, String methodName) {
  }
170149
public static void log(final Level level, final Throwable exception, final String message) {
		String nameOfException = exception.getClass().getName();
		String messageOfException = exception.getMessage();

		StringBuilder builder = new StringBuilder(BUFFER_SIZE);
		builder.append(level);
		builder.append(": ");
		builder.append(message);
		builder.append(" (");
		builder.append(nameOfException);
		if (messageOfException != null && !messageOfException.isEmpty()) {
			builder.append(": ");
			builder.append(messageOfException);
		}
		builder.append(")");

		System.err.println(builder);
	}
457720
private void log(Level level, String content, Throwable throwable) {
        String dateStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date());
        String log = String.format("[%s] %s [] - %s", level, dateStr, content);
        if(level.isLessSpecificThan(Level.ERROR)
                && level.isMoreSpecificThan(Level.OFF)) {
            System.err.println(log);
        } else {
            System.out.println(log);
        }

        if (throwable != null) {
            throwable.printStackTrace(System.err);
        }
    }