Skip to content

Commit

Permalink
Addresses #49
Browse files Browse the repository at this point in the history
"Processing" type messages are sent as info instead of debug.
  • Loading branch information
bartreardon committed Mar 27, 2024
1 parent 27f9f16 commit 1c38f94
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions Outset/Outset.swift
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ struct Outset: ParsableCommand {
// perform log file rotation
performLogRotation(logFolderPath: logDirectory, logFileBaseName: logFileName, maxLogFiles: logFileMaxCount)

writeLog("Processing scheduled runs for boot", logLevel: .debug)
writeLog("Processing scheduled runs for boot", logLevel: .info)
ensureWorkingFolders()

writeOutsetPreferences(prefs: prefs)
Expand Down Expand Up @@ -190,15 +190,15 @@ struct Outset: ParsableCommand {
}

if loginWindow {
writeLog("Processing scheduled runs for login window", logLevel: .debug)
writeLog("Processing scheduled runs for login window", logLevel: .info)

if !folderContents(path: loginWindowDir).isEmpty {
processItems(loginWindowDir)
}
}

if login {
writeLog("Processing scheduled runs for login", logLevel: .debug)
writeLog("Processing scheduled runs for login", logLevel: .info)
if !prefs.ignoredUsers.contains(consoleUser) {
if !folderContents(path: loginOnceDir).isEmpty {
processItems(loginOnceDir, once: true, override: prefs.overrideLoginOnce)
Expand All @@ -214,7 +214,7 @@ struct Outset: ParsableCommand {
}

if loginPrivileged {
writeLog("Processing scheduled runs for privileged login", logLevel: .debug)
writeLog("Processing scheduled runs for privileged login", logLevel: .info)
if checkFileExists(path: loginPrivilegedTrigger) {
pathCleanup(pathname: loginPrivilegedTrigger)
}
Expand All @@ -231,7 +231,7 @@ struct Outset: ParsableCommand {
}

if onDemand {
writeLog("Processing on-demand", logLevel: .debug)
writeLog("Processing on-demand", logLevel: .info)
if !folderContents(path: onDemandDir).isEmpty {
if !["root", "loginwindow"].contains(consoleUser) {
let currentUser = NSUserName()
Expand All @@ -248,7 +248,7 @@ struct Outset: ParsableCommand {
}

if loginEvery {
writeLog("Processing scripts in login-every", logLevel: .debug)
writeLog("Processing scripts in login-every", logLevel: .info)
if !prefs.ignoredUsers.contains(consoleUser) {
if !folderContents(path: loginEveryDir).isEmpty {
processItems(loginEveryDir)
Expand All @@ -257,7 +257,7 @@ struct Outset: ParsableCommand {
}

if loginOnce {
writeLog("Processing scripts in login-once", logLevel: .debug)
writeLog("Processing scripts in login-once", logLevel: .info)
if !prefs.ignoredUsers.contains(consoleUser) {
if !folderContents(path: loginOnceDir).isEmpty {
processItems(loginOnceDir, once: true, override: prefs.overrideLoginOnce)
Expand All @@ -268,7 +268,7 @@ struct Outset: ParsableCommand {
}

if cleanup {
writeLog("Cleaning up on-demand directory.", logLevel: .debug)
writeLog("Cleaning up on-demand directory.", logLevel: .info)
if checkFileExists(path: onDemandTrigger) { pathCleanup(pathname: onDemandTrigger) }
if checkFileExists(path: cleanupTrigger) { pathCleanup(pathname: cleanupTrigger) }
if !folderContents(path: onDemandDir).isEmpty { pathCleanup(pathname: onDemandDir) }
Expand Down
4 changes: 2 additions & 2 deletions Outset/Utils/ItemProcessing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func processItems(_ path: String, deleteItems: Bool=false, once: Bool=false, ove
}

if once {
writeLog("Processing run-once \(script)", logLevel: .debug)
writeLog("Processing run-once \(script)", logLevel: .info)
// If this is supposed to be a runonce item then we want to check to see if has an existing runonce entry
// looks for a key with the full script path. Writes the full path and run date when done
if !runOnceDict.contains(where: {$0.key == script}) {
Expand Down Expand Up @@ -119,7 +119,7 @@ func processItems(_ path: String, deleteItems: Bool=false, once: Bool=false, ove
}
}
} else {
writeLog("Processing script \(script)", logLevel: .debug)
writeLog("Processing script \(script)", logLevel: .info)
let (_, error, status) = runShellCommand(script, args: [consoleUser], verbose: true)
if status != 0 {
writeLog(error, logLevel: .error)
Expand Down

0 comments on commit 1c38f94

Please sign in to comment.