Creates a new Selector and will optimize it if possible.

@param logger the logger used for the optimization process.
@return the created Selector.
@throws NullPointerException if logger is null.
187562
static Selector newSelector(ILogger logger) {
        checkNotNull(logger, "logger");

        Selector selector;
        try {
            selector = Selector.open();
        } catch (IOException e) {
            throw new HazelcastException("Failed to open a Selector", e);
        }

        boolean optimize = Boolean.parseBoolean(System.getProperty("hazelcast.io.optimizeselector", "true"));
        if (optimize) {
            optimize(selector, logger);
        }
        return selector;
    }
748913
public Logger getLogger(String name) {
        Logger simpleLogger = loggerMap.get(name);
        if (simpleLogger != null) {
            return simpleLogger;
        } else {
            Logger newInstance = new SimpleLogger(name);
            Logger oldInstance = loggerMap.putIfAbsent(name, newInstance);
            return oldInstance == null ? newInstance : oldInstance;
        }
    }
1354092
public static Logger getLogger(final String logger)
   {
      LogAdapterFactory adapterFactory = getAdapterFactory();
      return adapterFactory.createLogAdapter(logger);
   }
1297768
def getLogger(name):
    '''  '''

    # Create logger and add a default NULL handler
    log = logging.getLogger(name)
    log.addHandler(_NullHandler())

    return log
530914
protected Logger wrap(String name, org.slf4j.Logger implementation) {
		return new Slf4jLogger(name, implementation);
	}
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;
    }
1283906
public static LogRecord create(SitLogger logger, LogLevelVo logLevel, TestStep testStep,
            String messageKey, Object... params) {

        String msg = MessageManager.getMessage(messageKey, params);

        switch (logLevel) {
            case INFO:
                logger.infoMsg(msg);
                break;
            case DEBUG:
                logger.debugMsg(msg);
                break;
            case ERROR:
                logger.errorMsg(msg);
                break;
            case WARN:
                logger.warnMsg(msg);
                break;
            default:
                logger.infoMsg(msg);
        }

        String testStepNo = testStep == null ? "xxx" : testStep.getNo();

        return new LogRecord(testStepNo, msg);
    }
99553
public static Logger getLogger(Class<?> key) {
        FailsafeLogger logger = LOGGERS.get(key.getName());
        if (logger == null) {
            LOGGERS.putIfAbsent(key.getName(), new FailsafeLogger(LOGGER_ADAPTER.getLogger(key)));
            logger = LOGGERS.get(key.getName());
        }
        return logger;
    }
211734
public void setLogger(String logger)
    {
        if(logger != null && logger.trim().length() > 0)
            this.logger = LoggerFactory.getLogger(logger);
    }
718987
public static synchronized void init(LogProviderConfig config) {
        if (config == null)
            throw new NullPointerException("LogProviderConfig must not be null");

        if (loggingConfig.compareAndSet(null, config)) {
            // Only initialize FFDC once -- all subsequent changes go through update
            // The synchronization of this method is gratuitous (just makes us feel better), 
            // it is called while the system is single threaded at startup. 

            // config.getTrDelegate() must not return null -- it should either
            // return a dummy/disabled delegate, or throw an exception so that startup
            // does not proceed.
            delegate = config.getFfdcDelegate();
            if (delegate == null)
                throw new NullPointerException("LogProviderConfig must provide a FFDCFilterService delegate");

            delegate.init(config);
        }
    }
1368568
@Override
    public String getMessageSelector() throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getMessageSelector");
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "getMessageSelector", theSelector);

        //if selector is null or empty return null
        if (theSelector == null || theSelector.trim().isEmpty())
            return null;

        return theSelector;
    }
918471
public static Logger getLogger(String name){
		if (name == null) {
			throw new IllegalArgumentException(
			        "The Logger name must not be null.");
		}

		return loggerRepository.getLogger(name);
	}
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);
  }
459206
private function createLogger(): LoggerInterface
    {
        $container = $this->iocContainer();
        if (empty($container) || !$container->has(LogsInterface::class)) {
            return new NullLogger();
        }

        //We are using class name as log channel (name) by default
        return $container->get(LogsInterface::class)->getLogger(static::class);
    }
1098984
public final static Selector getSelector() {
    synchronized (selectors) {
      Selector s = null;
      try {
        if (selectors.size() != 0) {
          s = selectors.pop();
        }
      } catch (EmptyStackException ex) {
      }

      int attempts = 0;
      try {
        while (s == null && attempts < 2) {
          selectors.wait(timeout);
          try {
            if (selectors.size() != 0) {
              s = selectors.pop();
            }
          } catch (EmptyStackException ex) {
            break;
          }
          attempts++;
        }
      } catch (InterruptedException ex) {
      }
      return s;
    }
  }
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;
    }
679689
public static UnindexedMatcher matcherWithSelector(Map<String, Object> selector) {
        ChildrenQueryNode root = buildExecutionTreeForSelector(selector);

        if (root == null) {
            return null;
        }

        UnindexedMatcher matcher = new UnindexedMatcher();
        matcher.root = root;

        return matcher;
    }