diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2017-01-26 16:31:54 -0500 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2017-01-26 16:31:54 -0500 |
commit | b7428844601fe8ab8ea2cd209279f641a92ccfdd (patch) | |
tree | 197ba826e9aab63b4ed26df852b5afc87127dba0 | |
parent | ba79fb669f316b89d615feb83d29c6af2e1f5e6e (diff) | |
download | sdl_ios-b7428844601fe8ab8ea2cd209279f641a92ccfdd.tar.gz |
Update logger to initialize on lifecycle initialization, not start
-rw-r--r-- | SmartDeviceLink/SDLLifecycleManager.m | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m index 3436b8844..cce5e89e8 100644 --- a/SmartDeviceLink/SDLLifecycleManager.m +++ b/SmartDeviceLink/SDLLifecycleManager.m @@ -65,7 +65,6 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready"; // Private properties @property (copy, nonatomic) SDLManagerReadyBlock readyHandler; -@property (assign, nonatomic) SDLLogOutput currentLogging; @end @@ -94,13 +93,16 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready"; _notificationDispatcher = [[SDLNotificationDispatcher alloc] init]; _responseDispatcher = [[SDLResponseDispatcher alloc] initWithNotificationDispatcher:_notificationDispatcher]; _registerResponse = nil; - _currentLogging = SDLLogOutputNone; // Managers _fileManager = [[SDLFileManager alloc] initWithConnectionManager:self]; _permissionManager = [[SDLPermissionManager alloc] init]; _lockScreenManager = [[SDLLockScreenManager alloc] initWithConfiguration:_configuration.lockScreenConfig notificationDispatcher:_notificationDispatcher presenter:[[SDLLockScreenPresenter alloc] init]]; + // Logging + [self.class sdl_updateLoggingWithFlags:self.configuration.lifecycleConfig.logFlags]; + + // Notifications [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(transportDidConnect) name:SDLTransportDidConnect object:_notificationDispatcher]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(transportDidDisconnect) name:SDLTransportDidDisconnect object:_notificationDispatcher]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(hmiStatusDidChange:) name:SDLDidChangeHMIStatusNotification object:_notificationDispatcher]; @@ -152,9 +154,6 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready"; } - (void)didEnterStateStarted { - // Set up our logging capabilities based on the config - [self.class sdl_updateLoggingWithFlags:self.configuration.lifecycleConfig.logFlags]; - // Start up the internal proxy object #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" @@ -413,13 +412,7 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready"; return YES; } -- (void)sdl_updateLoggingWithFlags:(SDLLogOutput)logFlags { - if (_currentLogging == logFlags) { - return; - } - - _currentLogging = logFlags; - ++ (void)sdl_updateLoggingWithFlags:(SDLLogOutput)logFlags { if (logFlags == SDLLogOutputNone) { [SDLDebugTool disable]; return; |