From 517be4bfa96277a89fea4b2fbf8b46c457833639 Mon Sep 17 00:00:00 2001 From: Valeriy Van Date: Sun, 28 Aug 2016 12:34:50 +0300 Subject: [PATCH] Changes [error localizedDescription] for [error description] in NSLog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There's no sense to log error messages in user’s locale. Imagine you’re trying to guess what's going on decrypting logs in hebrew, arabic, slavic. localizedDescription is for end user messages, not for logs. --- modules/videoio/src/cap_ios_abstract_camera.mm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/videoio/src/cap_ios_abstract_camera.mm b/modules/videoio/src/cap_ios_abstract_camera.mm index 702b1f2107..425032c6e0 100644 --- a/modules/videoio/src/cap_ios_abstract_camera.mm +++ b/modules/videoio/src/cap_ios_abstract_camera.mm @@ -323,7 +323,7 @@ NSError* error = nil; AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:device error:&error]; if (!input) { - NSLog(@"error creating input %@", [error localizedDescription]); + NSLog(@"error creating input %@", [error description]); } // support for autofocus @@ -333,7 +333,7 @@ device.focusMode = AVCaptureFocusModeContinuousAutoFocus; [device unlockForConfiguration]; } else { - NSLog(@"unable to lock device for autofocus configuration %@", [error localizedDescription]); + NSLog(@"unable to lock device for autofocus configuration %@", [error description]); } } [self.captureSession addInput:input]; @@ -436,7 +436,7 @@ device.focusMode = AVCaptureFocusModeLocked; [device unlockForConfiguration]; } else { - NSLog(@"unable to lock device for locked focus configuration %@", [error localizedDescription]); + NSLog(@"unable to lock device for locked focus configuration %@", [error description]); } } } @@ -450,7 +450,7 @@ device.focusMode = AVCaptureFocusModeContinuousAutoFocus; [device unlockForConfiguration]; } else { - NSLog(@"unable to lock device for autofocus configuration %@", [error localizedDescription]); + NSLog(@"unable to lock device for autofocus configuration %@", [error description]); } } } @@ -464,7 +464,7 @@ device.exposureMode = AVCaptureExposureModeLocked; [device unlockForConfiguration]; } else { - NSLog(@"unable to lock device for locked exposure configuration %@", [error localizedDescription]); + NSLog(@"unable to lock device for locked exposure configuration %@", [error description]); } } } @@ -478,7 +478,7 @@ device.exposureMode = AVCaptureExposureModeContinuousAutoExposure; [device unlockForConfiguration]; } else { - NSLog(@"unable to lock device for autoexposure configuration %@", [error localizedDescription]); + NSLog(@"unable to lock device for autoexposure configuration %@", [error description]); } } } @@ -492,7 +492,7 @@ device.whiteBalanceMode = AVCaptureWhiteBalanceModeLocked; [device unlockForConfiguration]; } else { - NSLog(@"unable to lock device for locked white balance configuration %@", [error localizedDescription]); + NSLog(@"unable to lock device for locked white balance configuration %@", [error description]); } } } @@ -506,7 +506,7 @@ device.whiteBalanceMode = AVCaptureWhiteBalanceModeContinuousAutoWhiteBalance; [device unlockForConfiguration]; } else { - NSLog(@"unable to lock device for auto white balance configuration %@", [error localizedDescription]); + NSLog(@"unable to lock device for auto white balance configuration %@", [error description]); } } }