summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuller, Alexander (A.) <amulle19@ford.com>2017-01-26 12:36:19 -0800
committerMuller, Alexander (A.) <amulle19@ford.com>2017-01-26 12:36:19 -0800
commitb61b16ee4b7a57653b1daeffd8117bc1bedd559f (patch)
tree71d2484010069fa2f1eb8939166ea8b84b13fea0
parent21cc10ffeed809384bb6aa8f88f3e7d20b7dcc4e (diff)
downloadsdl_ios-b61b16ee4b7a57653b1daeffd8117bc1bedd559f.tar.gz
Fixed issue with SDLDebugTool not keeping state with proxy recycle.
-rw-r--r--SmartDeviceLink/SDLDebugTool.m4
-rw-r--r--SmartDeviceLink/SDLLifecycleManager.m15
2 files changed, 17 insertions, 2 deletions
diff --git a/SmartDeviceLink/SDLDebugTool.m b/SmartDeviceLink/SDLDebugTool.m
index 8bf8c7bda..c07f206c1 100644
--- a/SmartDeviceLink/SDLDebugTool.m
+++ b/SmartDeviceLink/SDLDebugTool.m
@@ -185,6 +185,10 @@
}
- (void)sdl_enableDebugToLogFile {
+ if (self.debugToLogFile) {
+ return;
+ }
+
[SDLDebugTool logInfo:@"Enabling Log File" withType:SDLDebugType_Debug];
self.debugToLogFile = YES;
diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m
index 8f205afd4..1c565451a 100644
--- a/SmartDeviceLink/SDLLifecycleManager.m
+++ b/SmartDeviceLink/SDLLifecycleManager.m
@@ -63,6 +63,7 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
// Private properties
@property (copy, nonatomic) SDLManagerReadyBlock readyHandler;
+@property (assign, nonatomic) SDLLogOutput currentLogging;
@end
@@ -91,6 +92,7 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
_notificationDispatcher = [[SDLNotificationDispatcher alloc] init];
_responseDispatcher = [[SDLResponseDispatcher alloc] initWithNotificationDispatcher:_notificationDispatcher];
_registerResponse = nil;
+ _currentLogging = SDLLogOutputNone;
// Managers
_fileManager = [[SDLFileManager alloc] initWithConnectionManager:self];
@@ -387,8 +389,17 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
return YES;
}
- + (void)sdl_updateLoggingWithFlags : (SDLLogOutput)logFlags {
- [SDLDebugTool disable];
+- (void)sdl_updateLoggingWithFlags:(SDLLogOutput)logFlags {
+ if (_currentLogging == logFlags) {
+ return;
+ }
+
+ _currentLogging = logFlags;
+
+ if (logFlags == SDLLogOutputNone) {
+ [SDLDebugTool disable];
+ return;
+ }
if ((logFlags & SDLLogOutputConsole) == SDLLogOutputConsole) {
[SDLDebugTool enable];