[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - ios/Mobile
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Mar 22 15:04:26 UTC 2019
ios/Mobile/Document.mm | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 4f95ca0f245c6affd1c3bae19524bc2c2092831d
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Fri Mar 22 17:03:14 2019 +0200
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Fri Mar 22 17:03:14 2019 +0200
Truncate the JS expression for logging
diff --git a/ios/Mobile/Document.mm b/ios/Mobile/Document.mm
index 94052940b..5dcea04f3 100644
--- a/ios/Mobile/Document.mm
+++ b/ios/Mobile/Document.mm
@@ -101,14 +101,18 @@
js = [js stringByAppendingString:[NSString stringWithUTF8String:data.data()]];
js = [js stringByAppendingString:@"'});"];
- // LOG_TRC("Evaluating JavaScript: " << [js UTF8String]);
+ NSString *subjs = [js substringToIndex:std::min(100ul, js.length)];
+ if (subjs.length < js.length)
+ subjs = [subjs stringByAppendingString:@"..."];
+
+ // LOG_TRC("Evaluating JavaScript: " << [subjs UTF8String]);
dispatch_async(dispatch_get_main_queue(), ^{
[self.viewController.webView evaluateJavaScript:js
completionHandler:^(id _Nullable obj, NSError * _Nullable error)
{
if (error) {
- LOG_ERR("Error after " << [js UTF8String] << ": " << [[error localizedDescription] UTF8String]);
+ LOG_ERR("Error after " << [subjs UTF8String] << ": " << [[error localizedDescription] UTF8String]);
NSString *jsException = error.userInfo[@"WKJavaScriptExceptionMessage"];
if (jsException != nil)
LOG_ERR("JavaScript exception: " << [jsException UTF8String]);
More information about the Libreoffice-commits
mailing list