Added logging of which NonInteractive mode it's running

This commit is contained in:
Casper Sparre 2025-10-22 00:57:58 +02:00
parent a467e6f8b7
commit 7ee5fae714

View File

@ -514,6 +514,8 @@ public class Program
config.NonInteractiveMode = true; config.NonInteractiveMode = true;
Log.Logger = Log.Logger.ForContext("Mode", "NonInteractiveMode");
int indexOfSpecificListsArg = Array.FindIndex(args, a => a.Contains(SPECIFIC_LISTS_ARG, StringComparison.OrdinalIgnoreCase)); int indexOfSpecificListsArg = Array.FindIndex(args, a => a.Contains(SPECIFIC_LISTS_ARG, StringComparison.OrdinalIgnoreCase));
int indexOfSpecificUsersArg = Array.FindIndex(args, a => a.Contains(SPECIFIC_USERS_ARG, StringComparison.OrdinalIgnoreCase)); int indexOfSpecificUsersArg = Array.FindIndex(args, a => a.Contains(SPECIFIC_USERS_ARG, StringComparison.OrdinalIgnoreCase));
char[] separator = [',']; char[] separator = [','];
@ -527,6 +529,8 @@ public class Program
{ {
config.NonInteractiveSpecificLists = strListValues; config.NonInteractiveSpecificLists = strListValues;
config.NonInteractiveModeListName = string.Empty; config.NonInteractiveModeListName = string.Empty;
Log.Logger = Log.Logger.ForContext("NonInteractiveSpecificLists", string.Join(",", strListValues));
} }
} }
@ -537,6 +541,8 @@ public class Program
if (strUserValues.Length > 0) if (strUserValues.Length > 0)
{ {
config.NonInteractiveSpecificUsers = strUserValues; config.NonInteractiveSpecificUsers = strUserValues;
Log.Logger = Log.Logger.ForContext("NonInteractiveSpecificUsers", string.Join(",", strUserValues));
} }
} }
} }
@ -547,6 +553,8 @@ public class Program
{ {
config.NonInteractiveMode = true; config.NonInteractiveMode = true;
config.OutputBlockedUsers = true; config.OutputBlockedUsers = true;
Log.Logger = Log.Logger.ForContext("Mode", "OutputBlockedUsers");
} }
const string UPDATE_ALL_USER_INFO_ARG = "--update-userinfo"; const string UPDATE_ALL_USER_INFO_ARG = "--update-userinfo";
@ -555,6 +563,8 @@ public class Program
{ {
config.NonInteractiveMode = true; config.NonInteractiveMode = true;
config.UpdateAllUserInfo = true; config.UpdateAllUserInfo = true;
Log.Logger = Log.Logger.ForContext("Mode", "UpdateAllUserInfo");
} }
Log.Debug("Additional arguments:"); Log.Debug("Additional arguments:");