mgoulish commented on a change in pull request #1376:
URL: https://github.com/apache/qpid-dispatch/pull/1376#discussion_r728998085



##########
File path: src/log.c
##########
@@ -419,7 +419,10 @@ static void qd_log_source_free(qd_log_source_t *src) {
 
 bool qd_log_enabled(qd_log_source_t *source, qd_log_level_t level) {
     if (!source) return false;
-    int mask = source->mask == -1 ? default_log_source->mask : source->mask;
+    uint32_t mask = sys_atomic_get(&source->mask);
+    if (mask == QD_LOG_UNDEFINED) {
+        mask = sys_atomic_get(&default_log_source->mask);
+    }
     return level & mask;

Review comment:
       Actually, I think I disagree with this part:
      (mask == QD_LOG_UNDEFINED) ? false
   That means that if the user has not defined any mask, then we mask out 
anything.
   
   But the user, by not defining a mask, is telling us that he does not care 
about masking things out.
   Which means that the Right Thing to Do is to not mask anything out.
   Which is what a simple    "return !!(level & mask);"    would do.
   




-- 
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]

Reply via email to