Skip to content

Fix project settings resetting on domain reload #678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions source/IOSResolver/src/IOSResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ private static Assembly ResolveUnityEditoriOSXcodeExtension(
/// </summary>
static IOSResolver() {
// Load log preferences.
VerboseLoggingEnabled = VerboseLoggingEnabled;
UpdateLoggerLevel(VerboseLoggingEnabled);

// NOTE: We can't reference the UnityEditor.iOS.Xcode module in this
// method as the Mono runtime in Unity 4 and below requires all
Expand Down Expand Up @@ -1039,10 +1039,14 @@ public static bool VerboseLoggingEnabled {
get { return settings.GetBool(PREFERENCE_VERBOSE_LOGGING_ENABLED, defaultValue: false); }
set {
settings.SetBool(PREFERENCE_VERBOSE_LOGGING_ENABLED, value);
logger.Level = value ? LogLevel.Verbose : LogLevel.Info;
UpdateLoggerLevel(value);
}
}

private static void UpdateLoggerLevel(bool verboseLoggingEnabled) {
logger.Level = verboseLoggingEnabled ? LogLevel.Verbose : LogLevel.Info;
}

/// <summary>
/// Skip pod install when using workspace integration, let user manually run it.
/// </summary>
Expand Down
8 changes: 6 additions & 2 deletions source/PackageManagerResolver/src/PackageManagerResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static PackageManagerResolver() {

RunOnMainThread.Run(() => {
// Load log preferences.
VerboseLoggingEnabled = VerboseLoggingEnabled;
UpdateLoggerLevel(VerboseLoggingEnabled);
}, runNow: false);
}

Expand Down Expand Up @@ -645,9 +645,13 @@ public static bool VerboseLoggingEnabled {
get { return settings.GetBool(PreferenceVerboseLoggingEnabled, defaultValue: false); }
set {
settings.SetBool(PreferenceVerboseLoggingEnabled, value);
logger.Level = value ? LogLevel.Verbose : LogLevel.Info;
UpdateLoggerLevel(value);
}
}

private static void UpdateLoggerLevel(bool verboseLoggingEnabled) {
logger.Level = verboseLoggingEnabled ? LogLevel.Verbose : LogLevel.Info;
}

/// <summary>
/// Whether scoped registries are supported in current Unity editor.
Expand Down
8 changes: 6 additions & 2 deletions source/VersionHandlerImpl/src/VersionHandlerImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2290,7 +2290,7 @@ public static Logger Logger {
/// Load log preferences.
/// </summary>
private static void LoadLogPreferences() {
VerboseLoggingEnabled = VerboseLoggingEnabled;
UpdateLoggerLevel(VerboseLoggingEnabled);
}

/// <summary>
Expand Down Expand Up @@ -2512,9 +2512,13 @@ public static bool VerboseLoggingEnabled {
defaultValue: false); }
set {
settings.SetBool(PREFERENCE_VERBOSE_LOGGING_ENABLED, value);
logger.Level = value ? LogLevel.Verbose : LogLevel.Info;
UpdateLoggerLevel(value);
}
}

private static void UpdateLoggerLevel(bool verboseLoggingEnabled) {
logger.Level = verboseLoggingEnabled ? LogLevel.Verbose : LogLevel.Info;
}

/// <summary>
/// Enable / disable verbose logging.
Expand Down
Loading