[Libreoffice-commits] online.git: 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 cbbb2496ca449f784b91e071b89ad2e81cb4e711
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Fri Mar 22 16:37:32 2019 +0200
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Fri Mar 22 16:37:32 2019 +0200
Truncate the JS expression for logging
Change-Id: Ia287f5e26a80bdf0547128b8b2c9c9aff2ef89cd
diff --git a/ios/Mobile/Document.mm b/ios/Mobile/Document.mm
index 0eec31bda..2d0d12187 100644
--- a/ios/Mobile/Document.mm
+++ b/ios/Mobile/Document.mm
@@ -96,14 +96,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