Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-10889

Check for log level in zabbix_log() macro instead of __zbx_zabbix_log() function.

XMLWordPrintable

    • Sprint 50 (Mar 2019), Sprint 51 (Apr 2019)
    • 0.25

      In several places in our code the following pattern is used for logging.

      if (SUCCEED == zabbix_check_log_level(LOG_LEVEL_DEBUG))
      {
           zabbix_log(LOG_LEVEL_DEBUG, ...);
      }
      

      Functionally the check for log level before calling zabbix_log() is unnecessary as __zbx_zabbix_log() checks for that itself.

      However this is done for performance considerations - to avoid adding __zbx_zabbix_log() frame to the stack.

      A more generic and universal approach would be to move the check outside of __zbx_zabbix_log() into zabbix_log() macro.

            viktors.tjarve Viktors Tjarve
            sandis.neilands Sandis Neilands (Inactive)
            Team A
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: