本文整理了Java中org.apache.dubbo.common.logger.Logger.isDebugEnabled()
方法的一些代码示例,展示了Logger.isDebugEnabled()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.isDebugEnabled()
方法的具体详情如下:
包路径:org.apache.dubbo.common.logger.Logger
类名称:Logger
方法名:isDebugEnabled
[英]Is debug logging currently enabled?
[中]调试日志记录当前是否启用?
代码示例来源:origin: apache/incubator-dubbo
@Override
public boolean isDebugEnabled() {
try {
return logger.isDebugEnabled();
} catch (Throwable t) {
return false;
}
}
代码示例来源:origin: apache/incubator-dubbo
@Override
public boolean isDebugEnabled() {
try {
return logger.isDebugEnabled();
} catch (Throwable t) {
return false;
}
}
代码示例来源:origin: apache/incubator-dubbo
@Override
public boolean isDebugEnabled() {
return logger.isDebugEnabled();
}
代码示例来源:origin: apache/incubator-dubbo
@Override
public boolean isDebugEnabled() {
return logger.isDebugEnabled();
}
代码示例来源:origin: apache/incubator-dubbo
public static void debug(Logger logger, String msg, Throwable e) {
if (logger == null) {
return;
}
if (logger.isDebugEnabled()) {
logger.debug(msg, e);
}
}
代码示例来源:origin: apache/incubator-dubbo
public static void debug(Logger logger, Throwable e) {
if (logger == null) {
return;
}
if (logger.isDebugEnabled()) {
logger.debug(e);
}
}
代码示例来源:origin: apache/incubator-dubbo
public static void debug(Logger logger, Throwable e) {
if (logger == null) {
return;
}
if (logger.isDebugEnabled()) {
logger.debug(e);
}
}
代码示例来源:origin: apache/incubator-dubbo
public static void debug(Logger logger, String msg, Throwable e) {
if (logger == null) {
return;
}
if (logger.isDebugEnabled()) {
logger.debug(msg, e);
}
}
代码示例来源:origin: apache/incubator-dubbo
public static void debug(Logger logger, String msg) {
if (logger == null) {
return;
}
if (logger.isDebugEnabled()) {
logger.debug(msg);
}
}
代码示例来源:origin: apache/incubator-dubbo
public static void debug(Logger logger, String msg) {
if (logger == null) {
return;
}
if (logger.isDebugEnabled()) {
logger.debug(msg);
}
}
代码示例来源:origin: apache/incubator-dubbo
private void decode(Object message) {
if (message != null && message instanceof Decodeable) {
try {
((Decodeable) message).decode();
if (log.isDebugEnabled()) {
log.debug("Decode decodeable message " + message.getClass().getName());
}
} catch (Throwable e) {
if (log.isWarnEnabled()) {
log.warn("Call Decodeable.decode failed: " + e.getMessage(), e);
}
} // ~ end of catch
} // ~ end of if
} // ~ end of method decode
代码示例来源:origin: apache/incubator-dubbo
private void decode(Object message) {
if (message != null && message instanceof Decodeable) {
try {
((Decodeable) message).decode();
if (log.isDebugEnabled()) {
log.debug("Decode decodeable message " + message.getClass().getName());
}
} catch (Throwable e) {
if (log.isWarnEnabled()) {
log.warn("Call Decodeable.decode failed: " + e.getMessage(), e);
}
} // ~ end of catch
} // ~ end of if
} // ~ end of method decode
代码示例来源:origin: apache/incubator-dubbo
logger.warn("Find more than 1 spring extensions (beans) of type " + type.getName() + ", will stop auto injection. Please make sure you have specified the concrete parameter type and there's only one extension of that type.");
} catch (NoSuchBeanDefinitionException noBeanExe) {
if (logger.isDebugEnabled()) {
logger.debug("Error when get spring extension(bean) for type:" + type.getName(), noBeanExe);
代码示例来源:origin: apache/incubator-dubbo
@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
if (evt instanceof IdleStateEvent) {
try {
NettyChannel channel = NettyChannel.getOrAddChannel(ctx.channel(), url, handler);
if (logger.isDebugEnabled()) {
logger.debug("IdleStateEvent triggered, send heartbeat to channel " + channel);
}
Request req = new Request();
req.setVersion(Version.getProtocolVersion());
req.setTwoWay(true);
req.setEvent(Request.HEARTBEAT_EVENT);
channel.send(req);
} finally {
NettyChannel.removeChannelIfDisconnected(ctx.channel());
}
} else {
super.userEventTriggered(ctx, evt);
}
}
代码示例来源:origin: apache/incubator-dubbo
@Override
public void received(Channel channel, Object message) throws RemotingException {
setReadTimestamp(channel);
if (isHeartbeatRequest(message)) {
Request req = (Request) message;
if (req.isTwoWay()) {
Response res = new Response(req.getId(), req.getVersion());
res.setEvent(Response.HEARTBEAT_EVENT);
channel.send(res);
if (logger.isInfoEnabled()) {
int heartbeat = channel.getUrl().getParameter(Constants.HEARTBEAT_KEY, 0);
if (logger.isDebugEnabled()) {
logger.debug("Received heartbeat from remote channel " + channel.getRemoteAddress()
+ ", cause: The channel has no data-transmission exceeds a heartbeat period"
+ (heartbeat > 0 ? ": " + heartbeat + "ms" : ""));
}
}
}
return;
}
if (isHeartbeatResponse(message)) {
if (logger.isDebugEnabled()) {
logger.debug("Receive heartbeat response in thread " + Thread.currentThread().getName());
}
return;
}
handler.received(channel, message);
}
代码示例来源:origin: apache/incubator-dubbo
@Override
public void received(Channel channel, Object message) throws RemotingException {
setReadTimestamp(channel);
if (isHeartbeatRequest(message)) {
Request req = (Request) message;
if (req.isTwoWay()) {
Response res = new Response(req.getId(), req.getVersion());
res.setEvent(Response.HEARTBEAT_EVENT);
channel.send(res);
if (logger.isInfoEnabled()) {
int heartbeat = channel.getUrl().getParameter(Constants.HEARTBEAT_KEY, 0);
if (logger.isDebugEnabled()) {
logger.debug("Received heartbeat from remote channel " + channel.getRemoteAddress()
+ ", cause: The channel has no data-transmission exceeds a heartbeat period"
+ (heartbeat > 0 ? ": " + heartbeat + "ms" : ""));
}
}
}
return;
}
if (isHeartbeatResponse(message)) {
if (logger.isDebugEnabled()) {
logger.debug("Receive heartbeat response in thread " + Thread.currentThread().getName());
}
return;
}
handler.received(channel, message);
}
代码示例来源:origin: apache/incubator-dubbo
@Override
public synchronized void process(ConfigChangeEvent event) {
if (logger.isDebugEnabled()) {
logger.debug("Notification of tag rule, change type is: " + event.getChangeType() + ", raw rule is:\n " +
event.getValue());
}
try {
if (event.getChangeType().equals(ConfigChangeType.DELETED)) {
this.tagRouterRule = null;
} else {
this.tagRouterRule = TagRuleParser.parse(event.getValue());
}
} catch (Exception e) {
logger.error("Failed to parse the raw tag router rule and it will not take effect, please check if the " +
"rule matches with the template, the raw rule is:\n ", e);
}
}
代码示例来源:origin: apache/incubator-dubbo
@Override
public synchronized void process(ConfigChangeEvent event) {
if (logger.isDebugEnabled()) {
logger.debug("Notification of tag rule, change type is: " + event.getChangeType() + ", raw rule is:\n " +
event.getValue());
}
try {
if (event.getChangeType().equals(ConfigChangeType.DELETED)) {
this.tagRouterRule = null;
} else {
this.tagRouterRule = TagRuleParser.parse(event.getValue());
}
} catch (Exception e) {
logger.error("Failed to parse the raw tag router rule and it will not take effect, please check if the " +
"rule matches with the template, the raw rule is:\n ", e);
}
}
代码示例来源:origin: apache/incubator-dubbo
@Override
protected void doTask(Channel channel) {
try {
Long lastRead = lastRead(channel);
Long lastWrite = lastWrite(channel);
if ((lastRead != null && now() - lastRead > heartbeat)
|| (lastWrite != null && now() - lastWrite > heartbeat)) {
Request req = new Request();
req.setVersion(Version.getProtocolVersion());
req.setTwoWay(true);
req.setEvent(Request.HEARTBEAT_EVENT);
channel.send(req);
if (logger.isDebugEnabled()) {
logger.debug("Send heartbeat to remote channel " + channel.getRemoteAddress()
+ ", cause: The channel has no data-transmission exceeds a heartbeat period: "
+ heartbeat + "ms");
}
}
} catch (Throwable t) {
logger.warn("Exception when heartbeat to remote channel " + channel.getRemoteAddress(), t);
}
}
}
代码示例来源:origin: apache/incubator-dubbo
@Override
protected void doTask(Channel channel) {
try {
Long lastRead = lastRead(channel);
Long lastWrite = lastWrite(channel);
if ((lastRead != null && now() - lastRead > heartbeat)
|| (lastWrite != null && now() - lastWrite > heartbeat)) {
Request req = new Request();
req.setVersion(Version.getProtocolVersion());
req.setTwoWay(true);
req.setEvent(Request.HEARTBEAT_EVENT);
channel.send(req);
if (logger.isDebugEnabled()) {
logger.debug("Send heartbeat to remote channel " + channel.getRemoteAddress()
+ ", cause: The channel has no data-transmission exceeds a heartbeat period: "
+ heartbeat + "ms");
}
}
} catch (Throwable t) {
logger.warn("Exception when heartbeat to remote channel " + channel.getRemoteAddress(), t);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!