Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-1186

Make LOG macros look like proper statements

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: log
    • Labels:
    • Templates:
    • Team:
      Data Access and Database

      Description

      Some log macros are now defined as

      if (something) { doSomething; } 

      and this will cause unexpected behavior if people put semicolon after them. For example this code will break:

          if (data.empty())
              LOG_DEBUG("data is empty");
          else
              doSomething(data);

      It should be curable by placing

      do { ... } while(false)

      around it (and it will make closing semicolon required).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                salnikov Andy Salnikov
                Reporter:
                salnikov Andy Salnikov
                Reviewers:
                Kian-Tat Lim
                Watchers:
                Andy Salnikov, Kian-Tat Lim
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel