diff --git a/src/Android/Services/LocalizeService.cs b/src/Android/Services/LocalizeService.cs index ac62a1c7d..4318f5245 100644 --- a/src/Android/Services/LocalizeService.cs +++ b/src/Android/Services/LocalizeService.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Globalization; using Bit.App.Abstractions; using Bit.App.Models; @@ -25,13 +26,13 @@ namespace Bit.Droid.Services try { var fallback = ToDotnetFallbackLanguage(new PlatformCulture(netLanguage)); - Console.WriteLine(netLanguage + " failed, trying " + fallback + " (" + e1.Message + ")"); + Debug.WriteLine(netLanguage + " failed, trying " + fallback + " (" + e1.Message + ")"); ci = new CultureInfo(fallback); } catch (CultureNotFoundException e2) { // iOS language not valid .NET culture, falling back to English - Console.WriteLine(netLanguage + " couldn't be set, using 'en' (" + e2.Message + ")"); + Debug.WriteLine(netLanguage + " couldn't be set, using 'en' (" + e2.Message + ")"); ci = new CultureInfo("en"); } } @@ -40,7 +41,7 @@ namespace Bit.Droid.Services private string AndroidToDotnetLanguage(string androidLanguage) { - Console.WriteLine("Android Language:" + androidLanguage); + Debug.WriteLine("Android Language:" + androidLanguage); var netLanguage = androidLanguage; if (androidLanguage.StartsWith("zh")) { @@ -79,13 +80,13 @@ namespace Bit.Droid.Services // ONLY use cultures that have been tested and known to work } } - Console.WriteLine(".NET Language/Locale:" + netLanguage); + Debug.WriteLine(".NET Language/Locale:" + netLanguage); return netLanguage; } private string ToDotnetFallbackLanguage(PlatformCulture platCulture) { - Console.WriteLine(".NET Fallback Language:" + platCulture.LanguageCode); + Debug.WriteLine(".NET Fallback Language:" + platCulture.LanguageCode); var netLanguage = platCulture.LanguageCode; // use the first part of the identifier (two chars, usually); switch (platCulture.LanguageCode) { @@ -95,7 +96,7 @@ namespace Bit.Droid.Services // add more application-specific cases here (if required) // ONLY use cultures that have been tested and known to work } - Console.WriteLine(".NET Fallback Language/Locale:" + netLanguage + " (application-specific)"); + Debug.WriteLine(".NET Fallback Language/Locale:" + netLanguage + " (application-specific)"); return netLanguage; } diff --git a/src/iOS.Core/Services/LocalizeService.cs b/src/iOS.Core/Services/LocalizeService.cs index bdafe92d7..88f8dde94 100644 --- a/src/iOS.Core/Services/LocalizeService.cs +++ b/src/iOS.Core/Services/LocalizeService.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Globalization; using Bit.App.Abstractions; using Bit.App.Models; @@ -31,13 +32,13 @@ namespace Bit.iOS.Core.Services try { var fallback = ToDotnetFallbackLanguage(new PlatformCulture(netLanguage)); - Console.WriteLine(netLanguage + " failed, trying " + fallback + " (" + e1.Message + ")"); + Debug.WriteLine(netLanguage + " failed, trying " + fallback + " (" + e1.Message + ")"); ci = new CultureInfo(fallback); } catch (CultureNotFoundException e2) { // iOS language not valid .NET culture, falling back to English - Console.WriteLine(netLanguage + " couldn't be set, using 'en' (" + e2.Message + ")"); + Debug.WriteLine(netLanguage + " couldn't be set, using 'en' (" + e2.Message + ")"); ci = new CultureInfo("en"); } } @@ -47,7 +48,7 @@ namespace Bit.iOS.Core.Services private string iOSToDotnetLanguage(string iOSLanguage) { - Console.WriteLine("iOS Language:" + iOSLanguage); + Debug.WriteLine("iOS Language:" + iOSLanguage); var netLanguage = iOSLanguage; if (iOSLanguage.StartsWith("zh-Hant") || iOSLanguage.StartsWith("zh-HK")) { @@ -77,13 +78,13 @@ namespace Bit.iOS.Core.Services } } - Console.WriteLine(".NET Language/Locale:" + netLanguage); + Debug.WriteLine(".NET Language/Locale:" + netLanguage); return netLanguage; } private string ToDotnetFallbackLanguage(PlatformCulture platCulture) { - Console.WriteLine(".NET Fallback Language:" + platCulture.LanguageCode); + Debug.WriteLine(".NET Fallback Language:" + platCulture.LanguageCode); // Use the first part of the identifier (two chars, usually); var netLanguage = platCulture.LanguageCode; switch (platCulture.LanguageCode) @@ -97,7 +98,7 @@ namespace Bit.iOS.Core.Services // add more application-specific cases here (if required) // ONLY use cultures that have been tested and known to work } - Console.WriteLine(".NET Fallback Language/Locale:" + netLanguage + " (application-specific)"); + Debug.WriteLine(".NET Fallback Language/Locale:" + netLanguage + " (application-specific)"); return netLanguage; } diff --git a/src/iOS.Core/Views/Toast.cs b/src/iOS.Core/Views/Toast.cs index 86c5a9922..d3d1d735a 100644 --- a/src/iOS.Core/Views/Toast.cs +++ b/src/iOS.Core/Views/Toast.cs @@ -1,6 +1,7 @@ using Bit.App.Utilities; using Foundation; using System; +using System.Diagnostics; using UIKit; using Xamarin.Forms; using Xamarin.Forms.Platform.iOS; @@ -110,7 +111,7 @@ namespace Bit.iOS.Core.Views } else { - Console.WriteLine("Toast needs a keyWindows to display."); + Debug.WriteLine("Toast needs a keyWindows to display."); } } diff --git a/src/watchOS/bitwarden/bitwarden WatchKit Extension/Services/CryptoService.swift b/src/watchOS/bitwarden/bitwarden WatchKit Extension/Services/CryptoService.swift index 4556a006f..b2007d5ba 100644 --- a/src/watchOS/bitwarden/bitwarden WatchKit Extension/Services/CryptoService.swift +++ b/src/watchOS/bitwarden/bitwarden WatchKit Extension/Services/CryptoService.swift @@ -34,7 +34,7 @@ public class CryptoService{ let item = try JSONDecoder().decode(type, from: decryptedData) return item } catch { - assertionFailure("Fail to decode item for keychain: \(error)") + Log.e("Fail to decode item for keychain: \(error)") return nil } }