本文整理了Java中org.tinygroup.logger.Logger.isEnabled()
方法的一些代码示例,展示了Logger.isEnabled()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.isEnabled()
方法的具体详情如下:
包路径:org.tinygroup.logger.Logger
类名称:Logger
方法名:isEnabled
[英]判定某个级别是否启用
[中]判定某个级别是否启用
代码示例来源:origin: org.tinygroup/org.tinygroup.sqlexecutor
private boolean isPrintable(final Method method) {
return LOGGER.isEnabled(LogLevel.TRACE)
&& "visit".equals(method.getName());
}
代码示例来源:origin: org.tinygroup/org.tinygroup.sqlexecutor
/**
* 打印SQL解析调用树.
*
* @param target
* 待增强类
* @param <T>
* 泛型
* @return 增强后的新类的对象
*/
@SuppressWarnings("unchecked")
public static <T> T enhance(final Class<T> target) {
if (LOGGER.isEnabled(LogLevel.TRACE)) {
Enhancer result = new Enhancer();
result.setSuperclass(target);
result.setCallback(new VisitorHandler());
return (T) result.create();
} else {
try {
return target.newInstance();
} catch (final InstantiationException ex) {
LOGGER.errorMessage("create Visitor exception", ex);
throw new ParsedSqlException(ex);
} catch (IllegalAccessException ex) {
LOGGER.errorMessage("create Visitor exception", ex);
throw new ParsedSqlException(ex);
}
}
}
代码示例来源:origin: org.tinygroup/org.tinygroup.remoteconfig.zk
try {
List<Environment> envList = new ArrayList<Environment>(ZKDefaultEnvManager.getAll().values());
if (LOGGER.isEnabled(LogLevel.INFO)) {
for (Environment env : envList) {
LOGGER.logMessage(LogLevel.INFO, "环境[{0}]", env.getName());
代码示例来源:origin: org.tinygroup/org.tinygroup.remoteconfig.zk
public Map<String, ConfigValue> getAll(ConfigPath configPath) {
String path = PathHelper.createPath(configPath);
LOGGER.logMessage(LogLevel.INFO, "远程配置,批量获取节点[path={0}]", path);
try {
Map<String, ConfigValue> valueMap = ZKManager.getAll(configPath);
if (LOGGER.isEnabled(LogLevel.INFO)) {
for (String key : valueMap.keySet()) {
ConfigValue value = valueMap.get(key);
if (value != null) {
LOGGER.logMessage(LogLevel.INFO, "远程配置,节点信息[key={0} ,title={1} ,value={2} ,desc={3}]", key, value.getTitle(), value.getValue(), value.getDesc());
}
}
}
return valueMap;
} catch (Exception e) {
LOGGER.logMessage(LogLevel.ERROR, "远程配置,批量获取节点失败[path={0}]", e, path);
}
return null;
}
代码示例来源:origin: org.tinygroup/org.tinygroup.cepcoremutiremoteimpl
public Event getNodeRegRequestEvent() {
Context c = new ContextImpl();
List<ServiceInfo> list = getCore().getServiceInfos();
if (logger.isEnabled(LogLevel.INFO)) {
logger.logMessage(LogLevel.INFO, "当前节点服务数{}", list.size());
}
int version = getCore()
.getServiceInfosVersion();
c.put(NODE_REG_TO_SC_SERVICE_VERSION_KEY, version);
c.put(NODE_REG_TO_SC_SERVICE_KEY, list);
c.put(NODE_KEY, getNode());
Event e = Event.createEvent(NODE_REG_TO_SC_REQUEST, c);
return e;
}
代码示例来源:origin: org.tinygroup/org.tinygroup.cepcoremutiremoteimpl
/**
* 创建节点注册Event
*
* @return
*/
public Event getNodeReRegRequestEvent() {
Context c = new ContextImpl();
List<ServiceInfo> list = getCore().getServiceInfos();
if (logger.isEnabled(LogLevel.INFO)) {
logger.logMessage(LogLevel.INFO, "当前节点服务数{}", list.size());
}
int version = getCore()
.getServiceInfosVersion();
c.put(NODE_REG_TO_SC_SERVICE_VERSION_KEY, version);
c.put(NODE_REG_TO_SC_SERVICE_KEY, list);
c.put(NODE_KEY, getNode());
Event e = Event.createEvent(NODE_RE_REG_TO_SC_REQUEST, c);
return e;
}
代码示例来源:origin: org.tinygroup/org.tinygroup.remoteconfig.zk
if (LOGGER.isEnabled(LogLevel.INFO)) {
for (String key : defaultItemMap.keySet()) {
ConfigValue value = defaultItemMap.get(key);
内容来源于网络,如有侵权,请联系作者删除!