Skip to content

Commit 019650d

Browse files
committed
change some more logs
1 parent f5b7a43 commit 019650d

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
Requires macOS 12.0 and higher.
99

1010
### Added
11+
- Device within the `nudgeMinorUpdateEventLaunchDelay` now show current and delayed date
12+
- These logs also now show in the default Nudge logs when use the `logger` LaunchDaemon
13+
- Addresses [625](https://github.com/macadmins/nudge/issues/625)
1114

1215
### Changed
16+
- Some logs have been changed from `info` to `error`, `warning` or `notice` to give admins more visibility into Nudge behaviors
1317
- The `board-id` property has been moved to a `debug` log event
1418
- Works around reports like [623](https://github.com/macadmins/nudge/issues/623)
1519

Nudge/UI/Main.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -387,11 +387,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
387387
center.add(request)
388388
LogManager.info("Scheduled notification for terminated application \(applicationIdentifier)", logger: uiLog)
389389
case .denied:
390-
LogManager.info("Notifications are denied; cannot schedule notification for \(applicationIdentifier)", logger: uiLog)
390+
LogManager.error("Notifications are denied; cannot schedule notification for \(applicationIdentifier)", logger: uiLog)
391391
case .notDetermined:
392-
LogManager.info("Notification status not determined; cannot schedule notification for \(applicationIdentifier)", logger: uiLog)
392+
LogManager.warning("Notification status not determined; cannot schedule notification for \(applicationIdentifier)", logger: uiLog)
393393
@unknown default:
394-
LogManager.info("Unknown notification status; cannot schedule notification for \(applicationIdentifier)", logger: uiLog)
394+
LogManager.warning("Unknown notification status; cannot schedule notification for \(applicationIdentifier)", logger: uiLog)
395395
}
396396
}
397397
}
@@ -783,7 +783,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
783783
LogManager.error("Failed to terminate application: \(application.bundleIdentifier ?? "")", logger: utilsLog)
784784
return
785785
}
786-
LogManager.info("Successfully terminated application: \(application.bundleIdentifier ?? "")", logger: utilsLog)
786+
LogManager.notice("Successfully terminated application: \(application.bundleIdentifier ?? "")", logger: utilsLog)
787787
}
788788

789789
private func terminateApplications(afterInitialLaunch: Bool = false) {

Nudge/Utilities/Utils.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ import SystemConfiguration
1919
struct AppStateManager {
2020
func activateNudge() {
2121
if OptionalFeatureVariables.honorFocusModes {
22-
LogManager.info("honorFocusModes is configured - checking focus status. Warning: This feature may be unstable.", logger: utilsLog)
22+
LogManager.notice("honorFocusModes is configured - checking focus status. Warning: This feature may be unstable.", logger: utilsLog)
2323
if isFocusModeEnabled() {
24-
LogManager.info("Device has focus modes set - bypassing activation event", logger: utilsLog)
24+
LogManager.notice("Device has focus modes set - bypassing activation event", logger: utilsLog)
2525
return
2626
}
2727
}
@@ -96,7 +96,7 @@ struct AppStateManager {
9696

9797
// Bail Nudge if within gracePeriodLaunchDelay
9898
if gracePeriodLaunchDelay > gracePeriodPathCreationTimeInHours {
99-
LogManager.info("gracePeriodPath (\(gracePeriodPath)) within gracePeriodLaunchDelay (\(gracePeriodLaunchDelay)) - File age is \(gracePeriodPathCreationTimeInHours) hours", logger: uiLog)
99+
LogManager.notice("gracePeriodPath (\(gracePeriodPath)) within gracePeriodLaunchDelay (\(gracePeriodLaunchDelay)) - File age is \(gracePeriodPathCreationTimeInHours) hours", logger: uiLog)
100100
nudgePrimaryState.shouldExit = true
101101
return currentDate
102102
} else {
@@ -106,7 +106,7 @@ struct AppStateManager {
106106
if gracePeriodInstallDelay > gracePeriodPathCreationTimeInHours {
107107
if currentDate > originalRequiredInstallationDate {
108108
requiredInstallationDate = currentDate.addingTimeInterval(Double(gracePeriodsDelay) * 3600)
109-
LogManager.info("Device permitted for gracePeriodInstallDelay - setting date from: \(originalRequiredInstallationDate) to: \(requiredInstallationDate)", logger: uiLog)
109+
LogManager.notice("Device permitted for gracePeriodInstallDelay - setting date from: \(originalRequiredInstallationDate) to: \(requiredInstallationDate)", logger: uiLog)
110110
return requiredInstallationDate
111111
}
112112
} else {

0 commit comments

Comments
 (0)