Rewrite: Console_remote_log!(...)

I'm using Rust/wasm32, target=wasm32-unknown-unknown, running in Chrome.

Right now, I log to the console via console_log!(...) which is a macro that ends up calling web_sys::console::log_1(....).

I would like to develop a console_remote_log!(...) which does the following:

  1. logs remotely via http POST

  2. attach some type of cookie to the request

  3. batches the logs, log the earliest of either: (1) 5 seconds since last log or (2) N kilobytes of log since last log

I suspect this is a problem that already had a well defined solution. What strategies / crates are people currently using ?

1 Like

That's sort of what tracing aims to do but I'm not sure if any of the existing subscriber crates do exactly what you want

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.