From b2a40717c0096e3ca9268c860194082c2fda4af4 Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Tue, 26 Aug 2014 17:37:24 +0200 Subject: [PATCH] Add warnings to the console for the last commit Notify the developer about the issues by logging a warning to the console when the SDK is initialized more than once or startManager is invoked multiple times --- Classes/BITHockeyManager.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Classes/BITHockeyManager.m b/Classes/BITHockeyManager.m index 036f86eecd..cd0811d4e4 100644 --- a/Classes/BITHockeyManager.m +++ b/Classes/BITHockeyManager.m @@ -212,7 +212,10 @@ bitstadium_info_t bitstadium_library_info __attribute__((section("__TEXT,__bit_h - (void)startManager { if (!_validAppIdentifier) return; - if (_startManagerIsInvoked) return; + if (_startManagerIsInvoked) { + NSLog(@"[HockeySDK] Warning: startManager should only be invoked once! This call is ignored."); + return; + } if (![self isSetUpOnMainThread]) return; @@ -588,7 +591,10 @@ bitstadium_info_t bitstadium_library_info __attribute__((section("__TEXT,__bit_h } - (void)initializeModules { - if (_managersInitialized) return; + if (_managersInitialized) { + NSLog(@"[HockeySDK] Warning: The SDK should only be initialized once! This call is ignored."); + return; + } _validAppIdentifier = [self checkValidityOfAppIdentifier:_appIdentifier];