@Override public boolean isInfoEnabled() { return enabledLevel.implies(LogLevel.INFO); }
public RootLoggerContextImpl(String defaultLogLevelString, LoggerAdminImpl loggerAdminImpl) { super(null, loggerAdminImpl, null); LogLevel defaultLogLevel = LogLevel.WARN; if (defaultLogLevelString != null) { for (LogLevel level : LogLevel.values()) { if (level.name().equalsIgnoreCase(defaultLogLevelString)) { defaultLogLevel = level; break; } } } _defaultLevel = defaultLogLevel; }
private void log(LogLevel level, String format, Object... arguments) { if (!enabledLevel.implies(level)) { return; } StackTraceElement location = getLocation(); Arguments processedArguments = new Arguments(arguments); String message = processedArguments.isEmpty() ? format : formatMessage(format, processedArguments); logServiceImpl.getFactory().log(logServiceImpl.getBundle(), name, location, processedArguments.serviceReference(), level, level.ordinal(), message.toString(), processedArguments.throwable()); }
private Map<String, LogLevel> getLogLevels(Dictionary<String, Object> configDictionary) { Map<String, LogLevel> result = new HashMap<>(configDictionary.size()); for (Enumeration<String> keys = configDictionary.keys(); keys.hasMoreElements();) { String key = keys.nextElement(); Object v = configDictionary.get(key); if (v instanceof String) { try { result.put(key, LogLevel.valueOf((String) v)); } catch (IllegalArgumentException e) { // ignore invalid values } } } return result; }
private void log(LogLevel level, String format, Object... arguments) { if (!enabledLevel.implies(level)) { return; } StackTraceElement location = getLocation(); Arguments processedArguments = new Arguments(arguments); String message = processedArguments.isEmpty() ? format : formatMessage(format, processedArguments); logServiceImpl.getFactory().log(logServiceImpl.getBundle(), name, location, processedArguments.serviceReference(), level, level.ordinal(), message.toString(), processedArguments.serviceReference(), processedArguments.throwable()); }
private Map<String, LogLevel> getLogLevels(Dictionary<String, Object> configDictionary) { Map<String, LogLevel> result = new HashMap<>(configDictionary.size()); for (Enumeration<String> keys = configDictionary.keys(); keys.hasMoreElements();) { String key = keys.nextElement(); Object v = configDictionary.get(key); if (v instanceof String) { try { result.put(key, LogLevel.valueOf((String) v)); } catch (IllegalArgumentException e) { // ignore invalid values } } } return result; }
@Override public boolean isDebugEnabled() { return enabledLevel.implies(LogLevel.DEBUG); }
public RootLoggerContextImpl(String defaultLogLevelString, LoggerAdminImpl loggerAdminImpl) { super(null, loggerAdminImpl, null); LogLevel defaultLogLevel = LogLevel.WARN; if (defaultLogLevelString != null) { for (LogLevel level : LogLevel.values()) { if (level.name().equalsIgnoreCase(defaultLogLevelString)) { defaultLogLevel = level; break; } } } _defaultLevel = defaultLogLevel; }
String defaultLevelConfig = environmentInfo.getConfiguration(LoggerContext.LOGGER_CONTEXT_DEFAULT_LOGLEVEL); if (defaultLevelConfig != null) { defaultLevel = LogLevel.valueOf(defaultLevelConfig);
@Override public boolean isErrorEnabled() { return enabledLevel.implies(LogLevel.ERROR); }
void updateLoggerContext(Dictionary<String, Object> properties) { _lock.lock(); try { _levels = new HashMap<>(); if (properties != null) { for (Enumeration<String> enu = properties.keys(); enu.hasMoreElements();) { String key = enu.nextElement(); Object object = properties.get(key); if (object instanceof String) { String value = (String)object; for (LogLevel level : LogLevel.values()) { if (level.name().equalsIgnoreCase(value)) { _levels.put(key, level); break; } } } } } _loggerAdminImpl.keepLoggerContext(_name, this); } finally { _lock.unlock(); } }
String defaultLevelConfig = environmentInfo.getConfiguration(LoggerContext.LOGGER_CONTEXT_DEFAULT_LOGLEVEL); if (defaultLevelConfig != null) { defaultLevel = LogLevel.valueOf(defaultLevelConfig);
@Override public boolean isTraceEnabled() { return enabledLevel.implies(LogLevel.TRACE); }
void updateLoggerContext(Dictionary<String, Object> properties) { _lock.lock(); try { _levels = new HashMap<>(); if (properties != null) { for (Enumeration<String> enu = properties.keys(); enu.hasMoreElements();) { String key = enu.nextElement(); Object object = properties.get(key); if (object instanceof String) { String value = (String)object; for (LogLevel level : LogLevel.values()) { if (level.name().equalsIgnoreCase(value)) { _levels.put(key, level); break; } } } } } _loggerAdminImpl.keepLoggerContext(_name, this); } finally { _lock.unlock(); } }
@Override public boolean isInfoEnabled() { return enabledLevel.implies(LogLevel.INFO); }