Improve ssh remote error handling and logging (#15035)
Release Notes: - N/A
This commit is contained in:
parent
b0c525af5f
commit
5f7881fc1e
10 changed files with 103 additions and 16 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue