Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-3934

Move "Skipping loading of duplicate policy file" from verbose to debug

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Done
    • Priority: (None)
    • Resolution: Fixed
    • Affects Version/s: 3.15.5, 3.18.1
    • Fix Version/s: 3.20.0
    • Component/s: cf-agent, Logging
    • Labels:
      None
    • Story Points:
      0

      Description

      With respect to verbose logs like:

       verbose: Skipping loading of duplicate policy file /var/cfengine/inputs/lib/commands.cf
      

      These messages clutter up the verbose log for something that I do not think we have had tickets about, so it's really just noise in most cases of reading a verbose log. Many of these are generated by the MPF itself, so it's rather expected.

      I think that debug is a better fit.

      Furthermore, the code in the same area already log "Loading policy file" to DEBUG as well.

      https://github.com/cfengine/core/blob/5d361487ce2da4d61c6fad81afbe22806ca9f5b2/libpromises/loading.c#L325-L341

          Log(LOG_LEVEL_DEBUG, "Hashed policy file %s to %s", policy_file, hashbuffer);
      
          if (StringMapHasKey(policy_files_hashes, policy_file))
          {
              Log(LOG_LEVEL_VERBOSE, "Skipping loading of duplicate policy file %s", policy_file);
              return NULL;
          }
          else if (StringSetContains(parsed_files_checksums, hashbuffer))
          {
              Log(LOG_LEVEL_VERBOSE, "Skipping loading of duplicate (detected by hash) policy file %s",
                  policy_file);
              return NULL;
          }
          else
          {
              Log(LOG_LEVEL_DEBUG, "Loading policy file %s", policy_file);
          }
      

        Attachments

          Activity

            People

            Assignee:
            a10042 Nick Anderson
            Reporter:
            a10042 Nick Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: