When doing logging code analysis, I found that there are some logging statements which have same log message but with different verbosity level, I'm wondering why do they do that? (Those logging statements are introduced many years ago, it's hard to get in touch with the developers who introduced them)
Such as the link Here:https://github.com/apache/cloudstack/blob/893a88d225276e45f12f9490e6af2c94a81c2965/server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
if (vpcId == null) {
s_logger.trace("Network " + network + " is not associated with any VPC");
return false;
}
and
if (vpcId == null) {
s_logger.error("Network " + network + " is not associated with any VPC");
return routers;
}
The log message and if condition are totally the same, then what's the purpose of using different level here?