mirror of
https://github.com/bitwarden/mobile
synced 2025-12-10 21:33:36 +00:00
BEEEP: Abstract and Centralize Logging (#1663)
* Abstracted App Center Logging into its own component, so that we can have it centralized in one place and we avoid checking for FDroid on all the places we want to use it * Implemented the new logger where Crashes.TrackError was being used except on some specific cases * Improved logging, added a debug logger and removed AppCenter to be used on DEBUG
This commit is contained in:
committed by
GitHub
parent
34d0ecf64b
commit
db7ca3b93e
@@ -27,17 +27,28 @@ namespace Bit.iOS.Core.Utilities
|
||||
|
||||
public static void RegisterAppCenter()
|
||||
{
|
||||
#if !DEBUG
|
||||
var appCenterHelper = new AppCenterHelper(
|
||||
ServiceContainer.Resolve<IAppIdService>("appIdService"),
|
||||
ServiceContainer.Resolve<IStateService>("stateService"));
|
||||
var appCenterTask = appCenterHelper.InitAsync();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void RegisterLocalServices()
|
||||
{
|
||||
if (ServiceContainer.Resolve<ILogService>("logService", true) == null)
|
||||
if (ServiceContainer.Resolve<INativeLogService>("nativeLogService", true) == null)
|
||||
{
|
||||
ServiceContainer.Register<ILogService>("logService", new ConsoleLogService());
|
||||
ServiceContainer.Register<INativeLogService>("nativeLogService", new ConsoleLogService());
|
||||
}
|
||||
|
||||
if (ServiceContainer.Resolve<ILogger>("logger", true) == null)
|
||||
{
|
||||
#if DEBUG
|
||||
ServiceContainer.Register<ILogger>("logger", DebugLogger.Instance);
|
||||
#else
|
||||
ServiceContainer.Register<ILogger>("logger", Logger.Instance);
|
||||
#endif
|
||||
}
|
||||
|
||||
var preferencesStorage = new PreferencesStorageService(AppGroupId);
|
||||
@@ -156,7 +167,8 @@ namespace Bit.iOS.Core.Utilities
|
||||
ServiceContainer.Resolve<IApiService>("apiService"),
|
||||
ServiceContainer.Resolve<IMessagingService>("messagingService"),
|
||||
ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService"),
|
||||
ServiceContainer.Resolve<IDeviceActionService>("deviceActionService"));
|
||||
ServiceContainer.Resolve<IDeviceActionService>("deviceActionService"),
|
||||
ServiceContainer.Resolve<ILogger>("logger"));
|
||||
ServiceContainer.Register<IDeleteAccountActionFlowExecutioner>("deleteAccountActionFlowExecutioner", deleteAccountActionFlowExecutioner);
|
||||
|
||||
var verificationActionsFlowHelper = new VerificationActionsFlowHelper(
|
||||
|
||||
Reference in New Issue
Block a user