Factory method for creating NetUI Logger instances.

@param loggerClient the class whose logger to create
@return a {@link Logger} instance for the given class
515976
public static Logger getInstance(Class loggerClient) {
        return new Logger(org.apache.commons.logging.LogFactory.getLog(loggerClient.getName()));
    }
547759
protected Logger getSLF4JLogger(LogRecord record) {
        String name = record.getLoggerName();
        if (name == null) {
            name = UNKNOWN_LOGGER_NAME;
        }
        return LoggerFactory.getLogger(name);
    }
189430
public BlockingListMaker<K, E> log(Logger logger) {
        this.logger = logger == null ? NULL_LOGGER : logger;
        return this;
    }
1042749
@Override
    public Logger getLogger(String name) {
        Logger logger = loggerMap.get(name);
        if (logger != null)
            return logger;
        Logger newInstance = new LCLogger(name, LCCore.getApplication().getLoggerFactory().getLogger(name));
        Logger oldInstance = loggerMap.putIfAbsent(name, newInstance);
        return oldInstance == null ? newInstance : oldInstance;
    }
1128251
public void setLogger(Logger logger) {
		this.logger = logger == null ? LoggerFactory.getLogger(getClass()) : logger;
	}
402971
private Logger createLogger() {
    String loggerName = String.format("%s.%s.Script", project.getGroupId(), project.getArtifactId());
    return LoggerFactory.getLogger(loggerName);
  }
769309
public static ContextualLogger getLogger(Class clazz, LoggerContext context) {
    return new ContextualLogger(LoggerFactory.getLogger(clazz), context);
  }
437350
public static GoogleLogger forEnclosingClass() {
    // NOTE: It is _vital_ that the call to "caller finder" is made directly inside the static
    // factory method. See getCallerFinder() for more information.
    String loggingClass = Platform.getCallerFinder().findLoggingClass(GoogleLogger.class);
    return new GoogleLogger(Platform.getBackend(loggingClass));
  }
1060054
private static Logger getOrCreateLogger(final String name) {
		if (name == null || name.length() == 0) {
			return root;
		} else {
			Logger logger = loggers.get(name);
			if (logger == null) {
				Logger parent = getOrCreateLogger(reduce(name));
				logger = new Logger(parent, name);
				loggers.put(name, logger);
			}
			return logger;
		}
	}
217821
public Logger getLogger(String loggerName)
    {
        Logger logger;
        //lookup in the cache first
        logger = (Logger) cache.get(loggerName);

        if(logger == null)
        {
            try
            {
                // get the configuration (not from the configurator because this is independent)
                logger = createLoggerInstance(loggerName);
                if(getBootLogger().isDebugEnabled())
                {
                    getBootLogger().debug("Using logger class '"
                            + (getConfiguration() != null ? getConfiguration().getLoggerClass() : null)
                            + "' for " + loggerName);
                }
                // configure the logger
                getBootLogger().debug("Initializing logger instance " + loggerName);
                logger.configure(conf);
            }
            catch(Throwable t)
            {
                // do reassign check and signal logger creation failure
                reassignBootLogger(true);
                logger = getBootLogger();
                getBootLogger().error("[" + this.getClass().getName()
                            + "] Could not initialize logger " + (conf != null ? conf.getLoggerClass() : null), t);
            }
            //cache it so we can get it faster the next time
            cache.put(loggerName, logger);
            // do reassign check
            reassignBootLogger(false);
        }
        return logger;
    }
1131197
public Logger getOrCreateLogger(String clazz) {
      Logger logger = appenderLoggerMap.get(clazz);
      if (logger == null) {
          // If multiple threads do the puts, that is fine as it is a one time thing
          logger = Logger.getLogger(clazz);
          appenderLoggerMap.put(clazz, logger);
      }
      return logger;
  }
594823
public static Logger getLogger(String name) {
        ILoggerFactory iLoggerFactory = getILoggerFactory();
        return iLoggerFactory.getLogger(name);
    }
212169
public OutputStream decorateLogger(AbstractBuild build, OutputStream logger) throws IOException, InterruptedException {
        if (Util.isOverridden(ConsoleLogFilter.class, getClass(), "decorateLogger", Run.class, OutputStream.class)) {
            // old client calling newer implementation. forward the call.
            return decorateLogger((Run) build, logger);
        } else {
            // happens only if the subtype fails to override neither decorateLogger method
            throw new AssertionError("The plugin '" + this.getClass().getName() + "' still uses " +
                    "deprecated decorateLogger(AbstractBuild,OutputStream) method. " +
                    "Update the plugin to use setUp(Run,OutputStream) instead.");
        }
    }
530556
private static LogFactory detectLogFactory() {
        LogFactory logFactory;
        try {
            logFactory = new Slf4jLogFactory(true);
            logFactory.getLog(LogFactory.class).debug("Use [{}] Logger As Default.", logFactory.logFramworkName);
        } catch (Throwable e) {
            try {
                logFactory = new Log4jLogFactory();
                logFactory.getLog(LogFactory.class).debug("Use [{}] Logger As Default.", logFactory.logFramworkName);
            } catch (Throwable e2) {
                try {
                    logFactory = new Log4j2LogFactory();
                    logFactory.getLog(LogFactory.class).debug("Use [{}] Logger As Default.", logFactory.logFramworkName);
                } catch (Throwable e3) {
                    try {
                        logFactory = new JdkLogFactory();
                        logFactory.getLog(LogFactory.class).debug("Use [{}] Logger As Default.", logFactory.logFramworkName);
                    } catch (Throwable e5) {
                        logFactory = new ConsoleLogFactory();
                        logFactory.getLog(LogFactory.class).debug("Use [{}] Logger As Default.", logFactory.logFramworkName);
                    }
                }
            }
        }

        return logFactory;
    }
743076
@SuppressWarnings("unchecked")
   private static LogAdapterFactory createAdapterFactory()
   {
      List<LogAdapterFactory> factories = Iterators.asList(ServiceLoader.load(LogAdapterFactory.class));
      if (factories.isEmpty())
      {
         /*
          * Always fall back to the JDK, even if our service loading mechanism is hosed for some reason.
          */
         factories = Arrays.asList((LogAdapterFactory) new JDKLogAdapterFactory());
      }

      /*
       * Sort factories by priority.
       */
      Collections.sort(factories, new WeightedComparator());

      /*
       * Use the factory with the highest priority.
       */
      return factories.get(0);

   }
182433
private Logger createLoggerInstance(String loggerName) throws Exception
    {
        Class loggerClass = getConfiguration().getLoggerClass();
        Logger log = (Logger) ClassHelper.newInstance(loggerClass, String.class, loggerName);
        log.configure(getConfiguration());
        return log;
    }
484807
public final Logger getLogger()
    {
        if (logger == null)
        {
            logger = LoggerFactory.getLogger(clazz);
        }
        if (logger instanceof LocationAwareLogger)
        {
            return new LocationAwareWrapper(FQCN, (LocationAwareLogger) logger);
        }
        return this.logger;
    }