maedhroz commented on a change in pull request #1329:
URL: https://github.com/apache/cassandra/pull/1329#discussion_r752402744
##########
File path: src/java/org/apache/cassandra/utils/NoSpamLogger.java
##########
@@ -84,21 +85,31 @@ private boolean shouldLog(long nowNanos)
return nowNanos >= expected && compareAndSet(expected, nowNanos +
minIntervalNanos);
}
+ public boolean log(Level l, long nowNanos, Supplier<Object[]> objects)
+ {
+ if (!shouldLog(nowNanos)) return false;
+ return logNoCheck(l, objects.get());
+ }
+
public boolean log(Level l, long nowNanos, Object... objects)
{
if (!shouldLog(nowNanos)) return false;
+ return logNoCheck(l, objects);
+ }
+ private boolean logNoCheck(Level l, Object... objects)
+ {
switch (l)
{
- case INFO:
- wrapped.info(statement, objects);
- break;
- case WARN:
- wrapped.warn(statement, objects);
- break;
- case ERROR:
- wrapped.error(statement, objects);
- break;
+ case INFO:
+ wrapped.info(statement, objects);
+ break;
+ case WARN:
+ wrapped.warn(statement, objects);
+ break;
+ case ERROR:
+ wrapped.error(statement, objects);
+ break;
Review comment:
Fair, although I'm just making this consistent with every other `switch`
statement in the codebase.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]