change @Log4j2 to @Slf4j (#655)

* fix : change @Log4j2 to @Slf4j

* fix : add log error message

* fix : add log error message
pull/656/head
十大才子之首 3 years ago committed by GitHub
parent f936845d0e
commit 12ecbada8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -22,7 +22,7 @@ import cn.hippo4j.common.toolkit.Assert;
import cn.hippo4j.common.toolkit.StringUtil; import cn.hippo4j.common.toolkit.StringUtil;
import cn.hippo4j.core.toolkit.inet.InetUtils; import cn.hippo4j.core.toolkit.inet.InetUtils;
import lombok.Data; import lombok.Data;
import lombok.extern.log4j.Log4j2; import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.web.context.WebServerInitializedEvent; import org.springframework.boot.web.context.WebServerInitializedEvent;
import org.springframework.context.event.EventListener; import org.springframework.context.event.EventListener;
@ -32,7 +32,7 @@ import java.util.Objects;
/** /**
* Refresh listener abstract base class. * Refresh listener abstract base class.
*/ */
@Log4j2 @Slf4j
public abstract class AbstractRefreshListener<M> implements RefreshListener<Hippo4jConfigDynamicRefreshEvent, M> { public abstract class AbstractRefreshListener<M> implements RefreshListener<Hippo4jConfigDynamicRefreshEvent, M> {
protected static final String ALL = "*"; protected static final String ALL = "*";
@ -95,10 +95,10 @@ public abstract class AbstractRefreshListener<M> implements RefreshListener<Hipp
} }
String[] splitNodes = nodes.split(SEPARATOR); String[] splitNodes = nodes.split(SEPARATOR);
return Arrays.stream(splitNodes) return Arrays.stream(splitNodes)
.distinct() .distinct()
.map(IpAndPort::build) .map(IpAndPort::build)
.filter(Objects::nonNull) .filter(Objects::nonNull)
.anyMatch(i -> i.check(ipSegment, port)); .anyMatch(i -> i.check(ipSegment, port));
} }
/** /**
@ -123,7 +123,7 @@ public abstract class AbstractRefreshListener<M> implements RefreshListener<Hipp
} }
String[] ipPort = node.split(COLON); String[] ipPort = node.split(COLON);
if (ipPort.length != 2) { if (ipPort.length != 2) {
log.error("The IP address format is error:{}", node); log.error("The IP address format is error : {}", node);
return null; return null;
} }
return new IpAndPort(ipPort[0], ipPort[1]); return new IpAndPort(ipPort[0], ipPort[1]);

Loading…
Cancel
Save