-
Notifications
You must be signed in to change notification settings - Fork 684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
recorder logs in app ui does not work on windows #376
Comments
I'm trying to debug it, is it working on other OS ? |
yes on macos |
@tribhuwan-kumar is this issue still happening? |
yup, i tried to debug it but got no clue what's causing this issue, i'll try to fix it again |
@louis030195 i couldn't find what causing this issue :( the issue might be related to the only solution, i can think right now is writing a different recorder log viewer especially for windows or modifying this components logic for windows |
weird just using tauri native event stuff https://v2.tauri.app/develop/calling-frontend/#listening-to-events |
@louis030195 a member of tauri suggested this solution, i'll try to fix with it
import { listen } from "@tauri-apps/api/event";
const unlisten = listen<string>("sidecar_log", (event) => {
setLogs((prevLogs) => {
const newLogs = [...prevLogs, event.payload].slice(-100);
localforage.setItem("sidecar_logs", newLogs);
return newLogs;
});
});
return () => {
unlisten.then((f) => f());
};
tauri::async_runtime::spawn(async move {
while let Some(event) = rx.recv().await {
match event {
CommandEvent::Stdout(line) => {
let log_line = String::from_utf8(line).unwrap();
print!("{}", log_line);
app_handle.emit("sidecar_log", log_line).unwrap();
}
CommandEvent::Stderr(line) => {
let log_line = String::from_utf8(line).unwrap();
error!("Sidecar stderr: {}", log_line);
app_handle
.emit("sidecar_log", format!("ERROR: {}", log_line))
.unwrap();
}
_ => {}
}
}
}); |
for some reason
The text was updated successfully, but these errors were encountered: