#How to log objects using `tauri-plugin-log`

1 messages · Page 1 of 1 (latest)

little plume
#

Ive been using tauri-plugin-log in all of my projects and i like it a lot. One of my mis-understandings or gripes with it is that i can't figure out how to log objects from JS to the webview console as objects so that i can see them clearly and walk the object in the console. I have to print them as strings.

debug(`[Routes]: REST Response - ${JSON.stringify(backEndRes)}`)

Response is attached.

However, doing this:

debug(`[Routes]: REST Response - ${backEndRes}`)

Does not work, obviously, and i get the expected object [object] message.

Is there any way to post logs to the webView as objects?

honest pasture
#

If you just want to write to the dev tools window, use console.debug instead. The plugin requires everything as a String because Rust has no idea what a JS object is.

little plume
honest pasture
#

How does it show up currently? How do you expect it to show up?

little plume