void dumpIR()

in src/oomd/config/ConfigTypes.cpp [38:119]


void dumpIR(const Root& root) {
  int indent = 0;

  // Prekill hooks
  OLOG << getIndentSpaces(indent) << root.prekill_hooks.size()
       << " PrekillHooks=";
  ++indent;

  for (const auto& hook : root.prekill_hooks) {
    OLOG << getIndentSpaces(indent) << "Hook=" << hook.name;
    ++indent;

    // Print arguments
    OLOG << getIndentSpaces(indent) << "Args=";
    ++indent;
    for (const auto& pair : hook.args) {
      OLOG << getIndentSpaces(indent) << pair.first << "=" << pair.second;
    }
    indent -= 2;
  }
  --indent;

  // Rulesets
  OLOG << getIndentSpaces(indent) << root.rulesets.size() << " Rulesets=";
  ++indent;

  for (const auto& ruleset : root.rulesets) {
    OLOG << getIndentSpaces(indent) << "Ruleset=" << ruleset.name;
    ++indent;

    // Print DropIn config
    OLOG << getIndentSpaces(indent) << "DropIn=";
    ++indent;
    OLOG << getIndentSpaces(indent)
         << "Detectors=" << ruleset.dropin.detectorgroups_enabled;
    OLOG << getIndentSpaces(indent)
         << "Actions=" << ruleset.dropin.actiongroup_enabled;
    OLOG << getIndentSpaces(indent)
         << "DisableOnDrop=" << ruleset.dropin.disable_on_drop_in;
    --indent;

    OLOG << getIndentSpaces(indent) << "SilenceLogs=" << ruleset.silence_logs;

    // Print DetectorGroup's
    for (const auto& dg : ruleset.dgs) {
      OLOG << getIndentSpaces(indent) << "DetectorGroup=" << dg.name;
      ++indent;

      // Print Detectors
      for (const auto& d : dg.detectors) {
        OLOG << getIndentSpaces(indent) << "Detector=" << d.name;
        ++indent;
        OLOG << getIndentSpaces(indent) << "Args=";
        ++indent;

        // Print arguments
        for (const auto& pair : d.args) {
          OLOG << getIndentSpaces(indent) << pair.first << "=" << pair.second;
        }
        indent -= 2;
      }
      --indent;
    }

    // Print Action's
    for (const auto& act : ruleset.acts) {
      OLOG << getIndentSpaces(indent) << "Action=" << act.name;
      ++indent;
      OLOG << getIndentSpaces(indent) << "Args=";
      ++indent;

      // Print arguments
      for (const auto& pair : act.args) {
        OLOG << getIndentSpaces(indent) << pair.first << "=" << pair.second;
      }
      indent -= 2;
    }

    --indent;
  }
  --indent;
}