Attention is currently required from: Timur Davydov, fixeria, laforge, neels, osmith.
Timur Davydov has posted comments on this change by Timur Davydov. ( https://gerrit.osmocom.org/c/libosmocore/+/41813?usp=email )
Change subject: Add Emscripten build support and JS callback logging backend ......................................................................
Patch Set 26:
(2 comments)
File src/core/logging_emscripten.c:
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/83cbc39d_1d5cedc4?u... : PS25, Line 47: char subsys_buf[16];
That's due to "struct gsmtap_osmocore_log_hdr" being "char subsys[16]" because it's sent as fixed si […]
Thanks for the note. You’re right: the 16-byte limit comes from the GSMTAP on-wire header.
For the Emscripten logging path there is no such limitation: `on_log_wrapper()` receives pointers to NUL-terminated C strings, and on the JS/TS side we convert them using `AsciiToString()` (i.e. read until the terminating \0). So, keeping a separate `subsys_buf[16]` here is unnecessary “buffer-to-buffer” copying just to pass the subsystem name through.
I’ve updated the implementation accordingly to pass the subsystem name directly (falling back to an empty string when not available).
File src/core/logging_emscripten.c:
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/845c52af_a00924ab?u... : PS26, Line 45: const int msgLen = MAX_LOG_SIZE;
Simply drop the variable and use MAX_LOG_SIZE directly, otherwise you are simply duplicating stuff a […]
Sounds good, I’ve updated the code accordingly and now use MAX_LOG_SIZE directly, dropping the extra variable as suggested.