Skip to content

Commit

Permalink
Merge pull request #647 from poundbangbash/moar-logging
Browse files Browse the repository at this point in the history
Added logging for troubleshooting/diagnosing settings
  • Loading branch information
erikng authored Aug 22, 2024
2 parents ac23b5b + c8a2ff3 commit babfc5a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Nudge/UI/Main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -263,20 +263,28 @@ class AppDelegate: NSObject, NSApplicationDelegate {
nudgePrimaryState.activelyExploitedCVEs = activelyExploitedCVEs
switch (activelyExploitedCVEs, presentCVEs, AppStateManager().requireMajorUpgrade()) {
case (false, true, true):
LogManager.notice("Non Actively Exploited Major Upgrade detected. Using nonActivelyExploitedCVEsMajorUpgradeSLA value: \(OSVersionRequirementVariables.nonActivelyExploitedCVEsMajorUpgradeSLA)", logger: sofaLog)
slaExtension = TimeInterval(OSVersionRequirementVariables.nonActivelyExploitedCVEsMajorUpgradeSLA * 86400)
case (false, true, false):
LogManager.notice("Non Actively Exploited Minor Update detected. Using nonActivelyExploitedCVEsMinorUpdateSLA value: \(OSVersionRequirementVariables.nonActivelyExploitedCVEsMinorUpdateSLA)", logger: sofaLog)
slaExtension = TimeInterval(OSVersionRequirementVariables.nonActivelyExploitedCVEsMinorUpdateSLA * 86400)
case (true, false, true): // The selected major upgrade does not have CVEs, but the old OS does
LogManager.notice("Actively Exploited Major Upgrade detected. Using activelyExploitedCVEsMajorUpgradeSLA value: \(OSVersionRequirementVariables.activelyExploitedCVEsMajorUpgradeSLA)", logger: sofaLog)
slaExtension = TimeInterval(OSVersionRequirementVariables.activelyExploitedCVEsMajorUpgradeSLA * 86400)
case (true, true, true):
LogManager.notice("Actively Exploited Major Upgrade detected. Using activelyExploitedCVEsMajorUpgradeSLA value: \(OSVersionRequirementVariables.activelyExploitedCVEsMajorUpgradeSLA)", logger: sofaLog)
slaExtension = TimeInterval(OSVersionRequirementVariables.activelyExploitedCVEsMajorUpgradeSLA * 86400)
case (true, false, false):
LogManager.notice("Actively Exploited Minor Update detected. Using activelyExploitedCVEsMinorUpdateSLA value: \(OSVersionRequirementVariables.activelyExploitedCVEsMinorUpdateSLA)", logger: sofaLog)
slaExtension = TimeInterval(OSVersionRequirementVariables.activelyExploitedCVEsMinorUpdateSLA * 86400)
case (true, true, false):
LogManager.notice("Actively Exploited Minor Update detected. Using activelyExploitedCVEsMinorUpdateSLA value: \(OSVersionRequirementVariables.activelyExploitedCVEsMinorUpdateSLA)", logger: sofaLog)
slaExtension = TimeInterval(OSVersionRequirementVariables.activelyExploitedCVEsMinorUpdateSLA * 86400)
case (false, false, true):
LogManager.notice("Standard Major Upgrade detected. Using standardMajorUpgradeSLA value: \(OSVersionRequirementVariables.standardMajorUpgradeSLA)", logger: sofaLog)
slaExtension = TimeInterval(OSVersionRequirementVariables.standardMajorUpgradeSLA * 86400)
case (false, false, false):
LogManager.notice("Standard Minor Update detected. Using standardMinorUpdateSLA value: \(OSVersionRequirementVariables.standardMinorUpdateSLA)", logger: sofaLog)
slaExtension = TimeInterval(OSVersionRequirementVariables.standardMinorUpdateSLA * 86400)
default: // If we get here, something is wrong, use 90 days as a safety
LogManager.warning("SLA Extension logic failed, using 90 days as a safety", logger: sofaLog)
Expand Down

0 comments on commit babfc5a

Please sign in to comment.