private static final Log log = LogFactory.getLog(HtmlMenuRenderer.class);
7158
public void encodeEnd(FacesContext facesContext, UIComponent component)
            throws IOException
    {
        RendererUtils.checkParamValidity(facesContext, component, null);
        
        Map<String, List<ClientBehavior>> behaviors = null;
        if (component instanceof ClientBehaviorHolder)
        {
            behaviors = ((ClientBehaviorHolder) component).getClientBehaviors();
            if (!behaviors.isEmpty())
            {
                ResourceUtils.renderDefaultJsfJsInlineIfNecessary(
                        facesContext, facesContext.getResponseWriter());
            }
        }

        if (component instanceof UISelectMany)
        {
            renderMenu(facesContext,
                                         (UISelectMany)component,
                                         isDisabled(facesContext, component),
                                         getConverter(facesContext, component));
        }
        else if (component instanceof UISelectOne)
        {
            renderMenu(facesContext,
                                         (UISelectOne)component,
                                         isDisabled(facesContext, component),
                                         getConverter(facesContext, component));
        }
        else
        {
            throw new IllegalArgumentException("Unsupported component class " + component.getClass().getName());
        }
    }
1048391
public void log(Level level, Object... elements) {
		if(willWrite.compareTo(level)<=0) {
			StringBuilder sb = buildLine(level, new StringBuilder(),elements);
			if(context==null) {
				System.out.println(sb.toString());
			} else {
				context.log(sb.toString());
			}
		}
	}
412008
public void printHtmlMenuStart(PrintWriter out, ResourceBundle reg)
        throws DBException
    {
        this.printHtmlBanner(out, reg);
        this.printHtmlLogo(out, reg);
        this.printHtmlMenubar(out, reg);
        // Don't print the table start portion or the nav menus
    }
20340
private void findNestedClasspathElements(final List<SimpleEntry<String, ClasspathElement>> classpathElts,
            final LogNode log) {
        // Sort classpath elements into lexicographic order
        CollectionUtils.sortIfNotEmpty(classpathElts, new Comparator<SimpleEntry<String, ClasspathElement>>() {
            @Override
            public int compare(final SimpleEntry<String, ClasspathElement> o1,
                    final SimpleEntry<String, ClasspathElement> o2) {
                return o1.getKey().compareTo(o2.getKey());
            }
        });
        // Find any nesting of elements within other elements
        for (int i = 0; i < classpathElts.size(); i++) {
            // See if each classpath element is a prefix of any others (if so, they will immediately follow
            // in lexicographic order)
            final SimpleEntry<String, ClasspathElement> ei = classpathElts.get(i);
            final String basePath = ei.getKey();
            final int basePathLen = basePath.length();
            for (int j = i + 1; j < classpathElts.size(); j++) {
                final SimpleEntry<String, ClasspathElement> ej = classpathElts.get(j);
                final String comparePath = ej.getKey();
                final int comparePathLen = comparePath.length();
                boolean foundNestedClasspathRoot = false;
                if (comparePath.startsWith(basePath) && comparePathLen > basePathLen) {
                    // Require a separator after the prefix
                    final char nextChar = comparePath.charAt(basePathLen);
                    if (nextChar == '/' || nextChar == '!') {
                        // basePath is a path prefix of comparePath. Ensure that the nested classpath does
                        // not contain another '!' zip-separator (since classpath scanning does not recurse
                        // to jars-within-jars unless they are explicitly listed on the classpath)
                        final String nestedClasspathRelativePath = comparePath.substring(basePathLen + 1);
                        if (nestedClasspathRelativePath.indexOf('!') < 0) {
                            // Found a nested classpath root
                            foundNestedClasspathRoot = true;
                            // Store link from prefix element to nested elements
                            final ClasspathElement baseElement = ei.getValue();
                            if (baseElement.nestedClasspathRootPrefixes == null) {
                                baseElement.nestedClasspathRootPrefixes = new ArrayList<>();
                            }
                            baseElement.nestedClasspathRootPrefixes.add(nestedClasspathRelativePath + "/");
                            if (log != null) {
                                log.log(basePath + " is a prefix of the nested element " + comparePath);
                            }
                        }
                    }
                }
                if (!foundNestedClasspathRoot) {
                    // After the first non-match, there can be no more prefix matches in the sorted order
                    break;
                }
            }
        }
    }
968826
private static <T> void _logResult(T result, int level, int indentSize, StringBuilder info) {
        if(result instanceof Map) {
            level += 1;
            int finalLevel = level;
            ((Map)result).forEach((k, v) -> {
                info.append("\n");
                info.append(getTabBasedOnLevel(finalLevel, indentSize))
                        .append(k.toString())
                        .append(":");
                _logResult(v, finalLevel, indentSize, info);
            });
        } else if(result instanceof List) {
            int finalLevel = level;
            ((List)result).forEach(element -> _logResult(element, finalLevel, indentSize, info));
        } else if(result instanceof String) {
            info.append(" ").append(result);
        } else if(result != null) {
            try {
                logger.warn(getTabBasedOnLevel(level, indentSize) + "{}", result);
            } catch (Exception e) {
                logger.error("Cannot handle this type: {}", result.getClass().getTypeName());
            }
        }
    }
661884
private BuildLogger createLogger() {
        BuildLogger logger;
        if (args.loggerClassname != null) {
            try {
                logger = ClasspathUtils.newInstance(args.loggerClassname, Main.class.getClassLoader(),
                        BuildLogger.class);
            } catch (final BuildException e) {
                printErrorMessage("The specified logger class " + args.loggerClassname + " could not be used because "
                        + e.getMessage());
                throw new RuntimeException();
            }
        } else {
            logger = new DefaultLogger();
            ((DefaultLogger) logger).useColor(args.useColor);
        }

        logger.setMessageOutputLevel(args.msgOutputLevel);
        logger.setOutputPrintStream(out);
        logger.setErrorPrintStream(err);
        logger.setEmacsMode(args.emacsMode);

        return logger;
    }
686001
private Logger internalGetLogger(String name) {
    assert name != null : "Name was null";
    Logger rv = instances.get(name);

    if (rv == null) {
      Logger newLogger = null;
      try {
        newLogger = getNewInstance(name);
      } catch (Exception e) {
        throw new RuntimeException("Problem getting logger", e);
      }
      Logger tmp = instances.putIfAbsent(name, newLogger);
      // Return either the new logger we've just made, or one that was
      // created while we were waiting
      rv = tmp == null ? newLogger : tmp;
    }

    return (rv);
  }
503524
public void printHtmlNavMenu(PrintWriter out)
        throws DBException
    {
        String strForms = this.getProperty(HtmlConstants.FORMS);                // Html page
        if (strForms != null) if (strForms.equalsIgnoreCase(HtmlConstants.DISPLAY))
            ((BasePanel)this.getScreenField()).setProperty(DBParams.NAVMENUS, UserInfoModel.NO_ICONS);   // Don't display NAV menus
//x            return;   // Don't display NAV menus
        super.printHtmlNavMenu(out);
    }
196110
public static void logThreadInfo(Log log,
                                   String title,
                                   long minInterval) {
    boolean dumpStack = false;
    if (log.isInfoEnabled()) {
      synchronized (ReflectionUtils.class) {
        long now = System.currentTimeMillis();
        if (now - previousLogTime >= minInterval * 1000) {
          previousLogTime = now;
          dumpStack = true;
        }
      }
      if (dumpStack) {
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        printThreadInfo(new PrintWriter(buffer), title);
        log.info(buffer.toString());
      }
    }
  }
816945
public void logDomNodeList (String msg, NodeList nodeList) {
		StackTraceElement caller = StackTraceUtils.getCallerStackTraceElement ();

		String toLog = (msg != null ? msg + "\n" : "DOM nodelist:\n");
		for (int i = 0; i < nodeList.getLength (); i++) {
			toLog += domNodeDescription (nodeList.item (i), 0) + "\n";
		}

		if (caller != null) {
			logger.logp (Level.FINER, caller.getClassName (), caller.getMethodName () + "():" + caller.getLineNumber (), toLog);
		} else {
			logger.logp (Level.FINER, "(UnknownSourceClass)", "(unknownSourceMethod)", toLog);
		}
	}
529144
public static void generateLog(final SQLiteModelMethod method, MethodSpec.Builder methodBuilder) {
		SQLiteDaoDefinition daoDefinition = method.getParent();

		// log is enabled
		if (daoDefinition.isLogEnabled()) {
			// generate log section - BEGIN
			methodBuilder.addComment("log section BEGIN");
			methodBuilder.beginControlFlow("if (_context.isLogEnabled())");

			methodBuilder.addCode("// log for insert -- BEGIN \n");

			JQLChecker checker = JQLChecker.getInstance();
			final One<Boolean> inWhere = new One<Boolean>(false);

			String sql = checker.replace(method, method.jql, new JQLReplacerListenerImpl(method) {

				@Override
				public String onBindParameter(String bindParameterName, boolean inStatement) {
					if (inWhere.value0) {
						return "?";
					}

					return null;
				}

				@Override
				public void onWhereStatementBegin(Where_stmtContext ctx) {
					super.onWhereStatementBegin(ctx);

					inWhere.value0 = true;
				}

				@Override
				public void onWhereStatementEnd(Where_stmtContext ctx) {
					super.onWhereStatementEnd(ctx);

					inWhere.value0 = false;
				}
			});

			if (method.jql.containsSelectOperation) {
				// log
				// manage log
				methodBuilder.addCode("\n");
				methodBuilder.addStatement("$T.info($S)", Logger.class, sql);
			} else {
				sql = checker.replaceVariableStatements(method, sql, new JQLReplaceVariableStatementListenerImpl() {

					@Override
					public String onColumnNameSet(String statement) {
						return "%s";
					}

					@Override
					public String onColumnValueSet(String statement) {
						return "%s";
					}
				});

				methodBuilder.addStatement("$T _columnNameBuffer=new $T()", StringBuffer.class, StringBuffer.class);
				methodBuilder.addStatement("$T _columnValueBuffer=new $T()", StringBuffer.class, StringBuffer.class);
				methodBuilder.addStatement("String _columnSeparator=$S", "");

				SqlBuilderHelper.forEachColumnInContentValue(methodBuilder, method, "_contentValues.keys()", false, new OnColumnListener() {

					@Override
					public void onColumnCheck(MethodSpec.Builder methodBuilder, String columNameVariable) {
						methodBuilder.addStatement("_columnNameBuffer.append(_columnSeparator+$L)", columNameVariable);
						methodBuilder.addStatement("_columnValueBuffer.append(_columnSeparator+$S+$L)", ":", columNameVariable);
						methodBuilder.addStatement("_columnSeparator=$S", ", ");

					}
				});

				methodBuilder.addStatement("$T.info($S, _columnNameBuffer.toString(), _columnValueBuffer.toString())", Logger.class, sql);
			}
			generateLogForContentValues(method, methodBuilder);

			methodBuilder.addCode("// log for insert -- END \n\n");
			SqlBuilderHelper.generateLogForWhereParameters(method, methodBuilder);

			// generate log section - END
			methodBuilder.endControlFlow();
			methodBuilder.addComment("log section END");
		}
	}
1097253
function (name, loggerContext) {
    /**
     * Logger name
     */
    this.name = name;

    /**
     * Reference to the logger context that created this logger
     *
     * The reference is used to create appenders and layouts when
     * configuration is applied.
     */
    this.loggerContext = loggerContext;

    /**
     * Parent logger. All loggers have a parent except the root logger
     */
    this.parent = null;

    /**
     * Children loggers. Mostly used during initialization to propagate
     * the configuration.
     */
    this.children = [];

    /**
     * Appenders associated with the logger. Set during initialization
     */
    this.appenders = [];

    /**
     * Logger filter. Set during initialization
     */
    this.filter = null;

    /**
     * The trace level of the logger. Log events whose level is below that
     * level are logged. Others are discarded.
     */
    this.level = 'inherit';

    /**
     * Additivity flag. Log events are not propagated to the parent logger
     * if the flag is not set.
     */
    this.additive = true;

    /**
     * Function used to determine whether a log level is below the
     * trace level of the logger
     */
    if (this.loggerContext) {
      this.isBelow = function (level, referenceLevel) {
        return this.loggerContext.logLevel.isBelow(level, referenceLevel);
      };

      // Set trace functions for all registered levels
      utils.each(this.loggerContext.logLevel.getLevels(), function (level) {
        var self = this;
        if (!this[level]) {
          this[level] = function () {
            self.traceAtLevel(level, arguments);
          };
        }
      }, this);
    }
    else {
      this.isBelow = function () {
        return true;
      };
    }
  }
1361266
function log() {
      var defaultCount = 2,
          console = isHostType(context, 'console') && context.console,
          document = isHostType(context, 'document') && context.document,
          phantom = isHostType(context, 'phantom') && context.phantom,
          JSON = isHostType(context, 'JSON') && _.isFunction(context.JSON && context.JSON.stringify) && context.JSON;

      // Lazy define `log`.
      log = function(type, message, value) {
        var argCount = defaultCount,
            method = 'log';

        if (type == 'error') {
          argCount = 1;
          if (isHostType(console, type)) {
            method = type;
          } else {
            message = type + ': ' + message;
          }
        }
        // Avoid logging if in debug mode and running from the CLI.
        if (!isDebug || (document && !phantom)) {
          // Because `console.log` is a host method we don't assume `apply` exists.
          if (argCount < 2) {
            if (JSON) {
              value = [JSON.stringify(value), value];
              value = value[0] == 'null' ? value[1] : value[0];
            }
            console[method](message + (type == 'error' ? '' : ' ' + value));
          } else {
            console[method](message, value);
          }
        }
      };

      // For Rhino or RingoJS.
      if (!console && !document && _.isFunction(context.print)) {
        console = { 'log': print };
      }
      // Use noop for no log support.
      if (!isHostType(console, 'log')) {
        log = function() {};
      }
      // Avoid Safari 2 crash bug when passing more than 1 argument.
      else if (console.log.length == 1) {
        defaultCount = 1;
      }
      return log.apply(null, arguments);
    }
1199301
@Override
    public void logp(Level level, String sourceClass, String sourceMethod, String msg) {
        if (isLoggable(level)) {
            LogRecord logRecord = createLogRecord(level, msg, null, sourceClass, sourceMethod, null, null);
            log(logRecord);
        }
    }
665614
protected static void doLog(int connectionId, long elapsedNanos, Category category, String prepared, String sql, String url) {
	    // give it one more try if not initialized yet
	    if (logger == null) {
	      initialize();
	      if (logger == null) {
	    	  return;
	      }
	    }
    
      final String format = P6SpyOptions.getActiveInstance().getDateformat();
      final String stringNow;
      if (format == null) {
        stringNow = Long.toString(System.currentTimeMillis());
      } else {
        stringNow = new SimpleDateFormat(format).format(new java.util.Date()).trim();
      }

      logger.logSQL(connectionId, stringNow, TimeUnit.NANOSECONDS.toMillis(elapsedNanos), category, prepared, sql, url);

      final boolean stackTrace = P6SpyOptions.getActiveInstance().getStackTrace();
      if (stackTrace) {
	    final String stackTraceClass = P6SpyOptions.getActiveInstance().getStackTraceClass();
    	Exception e = new Exception();
        if (stackTraceClass != null) {
          StringWriter sw = new StringWriter();
          PrintWriter pw = new PrintWriter(sw);
          e.printStackTrace(pw);
          String stack = sw.toString();
          if (stack.indexOf(stackTraceClass) == -1) {
            e = null;
          }
        }
        if (e != null) {
          logger.logException(e);
        }
      }
  }
663580
@Override
  public Logger getLogger(String name) {
    String tag = createTag(name);
    Logger logger = loggerMap.get(tag);
    if (logger == null) {
      Logger newInstance = new TimberLoggerAdapter(tag);
      Logger oldInstance = loggerMap.putIfAbsent(tag, newInstance);
      logger = oldInstance == null ? newInstance : oldInstance;
    }
    return logger;
  }
1264442
function loggerFactory(
    events,
    Constants,
    assert,
    _,
    util,
    stack,
    nconf
) {
    var levels = _.keys(Constants.Logging.Levels);

    function getCaller (depth) {
        var current = stack.get()[depth];

        var file = current.getFileName().replace(
            Constants.WorkingDirectory,
            ''
        ) + ':' + current.getLineNumber();

        return file.replace(/^node_modules/, '');
    }

    function Logger (module) {
        var provides = util.provides(module);

        if (provides !== undefined) {
            this.module = provides;
        } else {
            if (_.isFunction(module)) {
                this.module = module.name;
            } else {
                this.module = module || 'No Module';
            }
        }
    }

    Logger.prototype.log = function (level, message, context) {
        assert.isIn(level, levels);
        assert.string(message, 'message');

        // Exit if the log level of this message is less than the minimum log level.
        var minLogLevel = nconf.get('minLogLevel');
        if ((minLogLevel === undefined) || (typeof minLogLevel !== 'number')) {
            minLogLevel = 0;
        }
        if (Constants.Logging.Levels[level] < minLogLevel) {
            return;
        }

        events.log({
            name: Constants.Name,
            host: Constants.Host,
            module: this.module,
            level: level,
            message: message,
            context: context,
            timestamp: new Date().toISOString(),
            caller: getCaller(3),
            subject: 'Server'
        });
    };

    _.forEach(levels, function(level) {
        Logger.prototype[level] = function (message, context) {
            this.log(level, message, context);
        };
    });

    Logger.prototype.deprecate = function (message, frames) {
        console.error([
            'DEPRECATION:',
            this.module,
            '-',
            message,
            getCaller(frames || 2)
        ].join(' '));
    };

    Logger.initialize = function (module) {
        return new Logger(module);
    };

    return Logger;
}