Skip to content

Commit ce40766

Browse files
committed
Merge pull request spring-cloud#588 from alexVengrovsk/master
* pull588: Add isDebugEnabled() check
2 parents a3a7c60 + 914fee9 commit ce40766

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

spring-cloud-netflix-eureka-server/src/main/java/org/springframework/cloud/netflix/eureka/server/event/LeaseManagerMessageBroker.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,21 @@ public void register(InstanceInfo info, boolean isReplication) {
4545

4646
@Override
4747
public void register(InstanceInfo info, int leaseDuration, boolean isReplication) {
48-
log.debug("register " + info.getAppName() + ", vip " + info.getVIPAddress()
49-
+ ", leaseDuration " + leaseDuration + ", isReplication " + isReplication);
48+
if (log.isDebugEnabled()) {
49+
log.debug("register " + info.getAppName() + ", vip " + info.getVIPAddress()
50+
+ ", leaseDuration " + leaseDuration + ", isReplication " + isReplication);
51+
}
5052
// TODO: what to publish from info (whole object?)
5153
this.ctxt.publishEvent(new EurekaInstanceRegisteredEvent(this, info,
5254
leaseDuration, isReplication));
5355
}
5456

5557
@Override
5658
public boolean cancel(String appName, String serverId, boolean isReplication) {
57-
log.debug("cancel " + appName + " serverId " + serverId + ", isReplication {}"
58-
+ isReplication);
59+
if (log.isDebugEnabled()) {
60+
log.debug("cancel " + appName + " serverId " + serverId + ", isReplication {}"
61+
+ isReplication);
62+
}
5963
this.ctxt.publishEvent(new EurekaInstanceCanceledEvent(this, appName, serverId,
6064
isReplication));
6165
return false;
@@ -64,8 +68,10 @@ public boolean cancel(String appName, String serverId, boolean isReplication) {
6468
@Override
6569
public boolean renew(final String appName, final String serverId,
6670
boolean isReplication) {
67-
log.debug("renew " + appName + " serverId " + serverId + ", isReplication {}"
68-
+ isReplication);
71+
if (log.isDebugEnabled()) {
72+
log.debug("renew " + appName + " serverId " + serverId + ", isReplication {}"
73+
+ isReplication);
74+
}
6975
List<Application> applications = PeerAwareInstanceRegistryImpl.getInstance()
7076
.getSortedApplications();
7177
for (Application input : applications) {

0 commit comments

Comments
 (0)