wasm: truncate string only if will log
Change-Id: I7bcc420633563abb858354a7cdb6c4a74c79b548 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>pull/7810/head
parent
87fdb4a185
commit
8d49d33da4
|
@ -24,7 +24,7 @@
|
|||
int coolwsd_server_socket_fd = -1;
|
||||
|
||||
const char* user_name;
|
||||
const int SHOW_JS_MAXLEN = 200;
|
||||
constexpr std::size_t SHOW_JS_MAXLEN = 200;
|
||||
|
||||
#define FILE_PATH "/sample.docx"
|
||||
static std::string fileURL = "file://" FILE_PATH;
|
||||
|
@ -74,11 +74,8 @@ static void send2JS(const std::vector<char>& buffer)
|
|||
js = js + "'});";
|
||||
}
|
||||
|
||||
std::string subjs = js.substr(0, std::min(std::string::size_type(SHOW_JS_MAXLEN), js.length()));
|
||||
if (js.length() > SHOW_JS_MAXLEN)
|
||||
subjs += "...";
|
||||
|
||||
LOG_TRC_NOFILE( "Evaluating JavaScript: " << subjs);
|
||||
LOG_TRC_NOFILE("Evaluating JavaScript: " << js.substr(0, std::min(SHOW_JS_MAXLEN, js.size()))
|
||||
<< (js.size() > SHOW_JS_MAXLEN ? "..." : ""));
|
||||
|
||||
MAIN_THREAD_EM_ASM(eval(UTF8ToString($0)), js.c_str());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue