Produces a concrete log template which logs messages into a SLF4J Logger.

@param loggerName Logger name
@param levelName Level name (info, debug, warn, etc.)
@param markerName Marker name
@return Logger
972516
public static <C> SLF4JLogTemplate<C> toSLF4J(String loggerName, String levelName, String markerName) {
		if ("debug".equalsIgnoreCase(levelName)) {
			return new SLF4JLogTemplate.Debug<>(loggerName, markerName);
		} else if ("info".equalsIgnoreCase(levelName)) {
			return new SLF4JLogTemplate.Info<>(loggerName, markerName);
		} else if ("warn".equalsIgnoreCase(levelName)) {
			return new SLF4JLogTemplate.Warn<>(loggerName, markerName);
		} else {
			throw new IllegalArgumentException("Invalid level name " + levelName);
		}
	}
738291
@Command(name = "GetLoggingLevel", inTypeDesc = "Device list", outTypeDesc = "Lg[i]=Logging Level. Str[i]=Device name.")
    public DevVarLongStringArray getLoggingLevel(final String[] deviceNames) {
        final int[] levels = new int[deviceNames.length];
        for (int i = 0; i < levels.length; i++) {
            levels[i] = LoggingManager.getInstance().getLoggingLevel(deviceNames[i]);
        }
        return new DevVarLongStringArray(levels, deviceNames);
    }
507626
public static Runnable writeTerminusMarker(final String nonce, final NodeSettings paths, final VoltLogger logger) {
        final File f = new File(paths.getVoltDBRoot(), VoltDB.TERMINUS_MARKER);
        return new Runnable() {
            @Override
            public void run() {
                try(PrintWriter pw = new PrintWriter(new FileWriter(f), true)) {
                    pw.println(nonce);
                } catch (IOException e) {
                    throw new RuntimeException("Failed to create .complete file for " + f.getName(), e);
                }
            }
        };
    }
577495
public void setLevel(String logger, Level level) {
      Logger log = getLogger(logger);
      log.setLevel(level);
      for (String loggerName : getLoggerNames()) {
         if (loggerName.startsWith(logger) && !loggerName.equals(logger)) {
            getLogger(loggerName).setLevel(level);
         }
      }
   }
202605
public static LoggerConfig[] setLogLevel(String loggerName, String level) {
    if(StringUtils.isBlank(loggerName)) {
      loggerName = ch.qos.logback.classic.Logger.ROOT_LOGGER_NAME;
    }
    LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
    log.debug("Setting {} to level {}", loggerName, level);
    ch.qos.logback.classic.Logger logger = null;
    try {
      logger = context.getLogger(loggerName);
      if(logger != null) {
        if(level.equals("null") || level.equals("none")) {
          logger.setLevel(null);
        } else {
          logger.setLevel(Level.toLevel(level));
        }
        logger = context.getLogger(loggerName);
        return new LoggerConfig[] {new LoggerConfig(logger.getName(), logger.getLevel() + "")};
      }
      return new LoggerConfig[] {};
    } catch(Throwable t) {
      log.warn("Failed to change log level for logger "+loggerName+" to level "+level, t);
      return new LoggerConfig[] {};
    }
  }
763416
public static void log(int logLevel, String format, Object... args) {
    assertInitialization();
    sLogger.log(logLevel, format, args);
  }
527285
@Override
    public void logMessage(final String fqcn, final Level level, final Marker marker, final Message msg,
            final Throwable t) {
        StackTraceElement element = null;
        if (fqcn != null) {
            element = getStackTraceElement(fqcn, Thread.currentThread().getStackTrace());
        }
        final StatusData data = new StatusData(element, level, msg, t, null);
        msgLock.lock();
        try {
            messages.add(data);
        } finally {
            msgLock.unlock();
        }
        // LOG4J2-1813 if system property "log4j2.debug" is defined, all status logging is enabled
        if (isDebugPropertyEnabled()) {
            logger.logMessage(fqcn, level, marker, msg, t);
        } else {
            if (listeners.size() > 0) {
                for (final StatusListener listener : listeners) {
                    if (data.getLevel().isMoreSpecificThan(listener.getStatusLevel())) {
                        listener.log(data);
                    }
                }
            } else {
                logger.logMessage(fqcn, level, marker, msg, t);
            }
        }
    }
387314
def new_log_level(level, name, logger_name=None):
    
    @CustomLogLevel(level, name, logger_name)
    def _default_template(logger, msg, *args, **kwargs):
        return msg, args, kwargs
284841
public static LogInfo setLogLevel(String logName, String level) throws IOException {
    LogInfo result = new LogInfo();
    if (StringUtils.isNotBlank(logName)) {
      result.setLogName(logName);
      Log log = LogFactory.getLog(logName);
      Logger logger = LoggerFactory.getLogger(logName);
      if (log instanceof Log4JLogger) {
        process(((Log4JLogger) log).getLogger(), level, result);
      } else if (log instanceof Jdk14Logger) {
        process(((Jdk14Logger) log).getLogger(), level, result);
      } else if (logger instanceof Log4jLoggerAdapter) {
        try {
          Field field = Log4jLoggerAdapter.class.getDeclaredField("logger");
          field.setAccessible(true);
          org.apache.log4j.Logger log4jLogger = (org.apache.log4j.Logger) field.get(logger);
          process(log4jLogger, level, result);
        } catch (NoSuchFieldException | IllegalAccessException e) {
          result.setMessage(e.getMessage());
        }
      } else {
        result.setMessage("Sorry, " + log.getClass() + " not supported.");
      }
    } else {
      result.setMessage("Please specify a correct logName.");
    }
    return result;
  }
1208869
public LoggerContext apply(LogLevelConfig logLevelConfig, Props props) {
    if (!ROOT_LOGGER_NAME.equals(logLevelConfig.getRootLoggerName())) {
      throw new IllegalArgumentException("Value of LogLevelConfig#rootLoggerName must be \"" + ROOT_LOGGER_NAME + "\"");
    }

    LoggerContext rootContext = getRootContext();
    logLevelConfig.getConfiguredByProperties().forEach((key, value) -> applyLevelByProperty(props, rootContext.getLogger(key), value));
    logLevelConfig.getConfiguredByHardcodedLevel().forEach((key, value) -> applyHardcodedLevel(rootContext, key, value));
    Level propertyValueAsLevel = getPropertyValueAsLevel(props, SONAR_LOG_LEVEL_PROPERTY);
    boolean traceGloballyEnabled = propertyValueAsLevel == Level.TRACE;
    logLevelConfig.getOffUnlessTrace().forEach(logger -> applyHardUnlessTrace(rootContext, logger, traceGloballyEnabled));
    return rootContext;
  }
1223750
public ProxyDataSourceBuilder logQueryByJUL(Level logLevel, String julLoggerName) {
        this.createJulQueryListener = true;
        this.julLogLevel = logLevel;
        this.julLoggerName = julLoggerName;
        return this;
    }
745504
public void log(Logger targetLogger)
    {
        Object[] argumentArray = getArgumentArray();
        if (getArgumentArray() == null) {
            log(targetLogger, getLevel(), getMarker(), getMessage(), getThrowable());
        } else {
            if (getThrowable() != null) {
                argumentArray = ArrayUtils.add(getArgumentArray(), getThrowable());
            }

            log(targetLogger, getLevel(), getMarker(), getMessage(), argumentArray);
        }
    }
649622
public void log (int level, String moduleName, String message)
    {
        getLogger(moduleName).log(getLevel(level), message);
    }
341300
public void log(java.util.logging.Level level, CharSequence message) {
    LogRecord rec = new ELKILogRecord(level, message);
    logger.log(rec);
  }
939251
function Logger(tag, logger) {
  this._tag = tag;
  this._logger = logger;
  this._level = 1;

  // support the various logging functions
  var _this = this;
  ['log', 'trace', 'debug', 'info', 'warn', 'warning', 'error', 'fatal', 'exception'].forEach(function(f) {
    _this[f] = function() {
      if (_this._logger && LEVEL[f] <= _this._level) {
        var message;
        // add the tag to the message
        for (var i = 0; i < arguments.length; ++i) {
          if (typeof arguments[i] === 'string') {
            arguments[i] = "["+_this._tag+"] " + arguments[i];
            message = arguments[i];
            break;
          }
        }
        var method = _this._logger[f] || _this._logger['log'];
        method.apply(_this._logger, arguments);
      }
    }
  });
}
909613
public SLF4JQueryCountLoggingServletFilter buildSlf4jFilter(SLF4JLogLevel logLevel) {
        if (logLevel != null) {
            this.slf4jLogLevel = logLevel;
        }

        SLF4JQueryCountLoggingServletFilter filter = new SLF4JQueryCountLoggingServletFilter();
        if (this.slf4jLogLevel != null) {
            filter.setLogLevel(this.slf4jLogLevel);
        }
        filter.setWriteAsJson(this.writeAsJson);
        return filter;
    }
1181081
public static @CheckForNull
    BugCollectionAndInstance findBugCollectionAndInstanceForMarker(IMarker marker) {

        IResource resource = marker.getResource();
        IProject project = resource.getProject();
        if (project == null) {
            // Also shouldn't happen.
            FindbugsPlugin.getDefault().logError("No project for warning marker");
            return null;
        }
        if (!isFindBugsMarker(marker)) {
            // log disabled because otherwise each selection in problems view
            // generates
            // 6 new errors (we need refactor all bug views to get rid of this).
            // FindbugsPlugin.getDefault().logError("Selected marker is not a FindBugs marker");
            // FindbugsPlugin.getDefault().logError(marker.getType());
            // FindbugsPlugin.getDefault().logError(FindBugsMarker.NAME);
            return null;
        }

        // We have a FindBugs marker. Get the corresponding BugInstance.
        String bugId = marker.getAttribute(FindBugsMarker.UNIQUE_ID, null);
        if (bugId == null) {
            FindbugsPlugin.getDefault().logError("Marker does not contain unique id for warning");
            return null;
        }

        try {
            BugCollection bugCollection = FindbugsPlugin.getBugCollection(project, null);
            if (bugCollection == null) {
                FindbugsPlugin.getDefault().logError("Could not get BugCollection for SpotBugs marker");
                return null;
            }

            String bugType = (String) marker.getAttribute(FindBugsMarker.BUG_TYPE);
            Integer primaryLineNumber = (Integer) marker.getAttribute(FindBugsMarker.PRIMARY_LINE);

            // compatibility
            if (primaryLineNumber == null) {
                primaryLineNumber = Integer.valueOf(getEditorLine(marker));
            }

            if (bugType == null) {
                FindbugsPlugin.getDefault().logError(
                        "Could not get find attributes for marker " + marker + ": (" + bugId + ", " + primaryLineNumber + ")");
                return null;
            }
            BugInstance bug = bugCollection.findBug(bugId, bugType, primaryLineNumber.intValue());
            if(bug == null) {
                FindbugsPlugin.getDefault().logError(
                        "Could not get find bug for marker on " + resource + ": (" + bugId + ", " + primaryLineNumber + ")");
                return null;
            }
            return new BugCollectionAndInstance(bugCollection, bug);
        } catch (CoreException e) {
            FindbugsPlugin.getDefault().logException(e, "Could not get BugInstance for SpotBugs marker");
            return null;
        }
    }