Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions packages/playit-cli/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use playit_ipc::model::{
use playitd::manager::{ensure_installed_service_running, stop_installed_service};

use crate::ui::UI;
use crate::ui::log_capture::{LogEntry, LogLevel as UiLogLevel};
use crate::ui::tui_app::{
AccountStatusInfo, AgentData, ConnectionStats, NoticeInfo, PendingTunnelInfo, TunnelInfo,
};
Expand Down Expand Up @@ -599,21 +598,6 @@ async fn apply_update(ui: &mut UI, update: ServiceUpdate, stdout_mode: bool) {
entry.target,
entry.message
);
} else if let Some(log_capture) = ui.log_capture() {
let level = match entry.level {
ServiceLogLevel::Error => UiLogLevel::Error,
ServiceLogLevel::Warn => UiLogLevel::Warn,
ServiceLogLevel::Info => UiLogLevel::Info,
ServiceLogLevel::Debug => UiLogLevel::Debug,
ServiceLogLevel::Trace => UiLogLevel::Trace,
};

log_capture.push(LogEntry {
level,
target: entry.target,
message: entry.message,
timestamp: entry.timestamp,
});
}
}
}
Expand Down
11 changes: 1 addition & 10 deletions packages/playit-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use playit_api_client::http_client::HttpClientError;
use playit_api_client::{PlayitApi, api::*};

use crate::signal_handle::get_signal_handle;
use crate::ui::log_capture::LogCaptureLayer;
use crate::ui::{UI, UISettings};

pub static API_BASE: LazyLock<String> =
Expand Down Expand Up @@ -179,7 +178,6 @@ async fn run_cli() -> Result<std::process::ExitCode, CliError> {
// Use log-only mode if stdout flag is set or if attach --stdout was requested.
let use_log_only = log_only || attach_stdout;

// Create UI first so we can get its log capture
let mut ui = UI::new(UISettings {
auto_answer: None,
log_only: use_log_only,
Expand All @@ -202,14 +200,7 @@ async fn run_cli() -> Result<std::process::ExitCode, CliError> {
Some(guard)
}
false => {
// TUI mode - set up log capture layer with filter
if let Some(log_capture) = ui.log_capture() {
let capture_layer = LogCaptureLayer::new(log_capture);
tracing_subscriber::registry()
.with(log_filter)
.with(capture_layer)
.init();
}
tracing_subscriber::registry().with(log_filter).init();
None
}
};
Expand Down
160 changes: 0 additions & 160 deletions packages/playit-cli/src/ui/log_capture.rs

This file was deleted.

13 changes: 0 additions & 13 deletions packages/playit-cli/src/ui/mod.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
use std::sync::Arc;

use crossterm::event::{self, Event, KeyCode, KeyEvent};
use playit_agent_core::utils::now_milli;

use crate::CliError;
use crate::signal_handle::get_signal_handle;

pub mod log_capture;
pub mod tui_app;
pub mod widgets;

pub use log_capture::LogCapture;
pub use tui_app::{AgentData, ConnectionStats, TuiApp};

/// UI mode - either TUI (interactive) or log-only (stdout)
Expand Down Expand Up @@ -75,15 +71,6 @@ impl UI {
}
}

/// Get the log capture for TUI mode
pub fn log_capture(&self) -> Option<Arc<LogCapture>> {
if let UI::Tui(tui) = self {
Some(tui.log_capture())
} else {
None
}
}

/// Run one iteration of the TUI event loop
/// Returns Ok(true) if should continue, Ok(false) if should quit
pub fn tick_tui(&mut self) -> Result<bool, CliError> {
Expand Down
Loading