Improve ssh remote error handling and logging (#15035)

Release Notes:

- N/A
This commit is contained in:
Max Brunsfeld 2024-07-23 13:29:56 -07:00 committed by GitHub
parent b0c525af5f
commit 5f7881fc1e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 103 additions and 16 deletions

View file

@ -31,6 +31,8 @@ project.workspace = true
remote.workspace = true
rpc.workspace = true
settings.workspace = true
serde.workspace = true
serde_json.workspace = true
smol.workspace = true
util.workspace = true
worktree.workspace = true

View file

@ -2,15 +2,28 @@ use fs::RealFs;
use futures::channel::mpsc;
use gpui::Context as _;
use remote::{
json_log::LogRecord,
protocol::{read_message, write_message},
SshSession,
};
use remote_server::HeadlessProject;
use smol::{io::AsyncWriteExt, stream::StreamExt as _, Async};
use std::{env, io, mem, process, sync::Arc};
use std::{
env,
io::{self, Write},
mem, process,
sync::Arc,
};
fn main() {
env::set_var("RUST_BACKTRACE", "1");
env_logger::builder()
.format(|buf, record| {
serde_json::to_writer(&mut *buf, &LogRecord::new(&record))?;
buf.write_all(b"\n")?;
Ok(())
})
.init();
let subcommand = std::env::args().nth(1);
match subcommand.as_deref() {
@ -25,8 +38,6 @@ fn main() {
}
}
env_logger::init();
gpui::App::headless().run(move |cx| {
HeadlessProject::init(cx);