Add some logs

This commit is contained in:
sxyazi 2024-07-25 17:28:22 +08:00
parent 011685c624
commit 14d6c96210
No known key found for this signature in database

View file

@ -48,8 +48,14 @@ impl Term {
.map_or(0, |b| b - b'0'),
Ordering::Relaxed,
);
} else {
tracing::error!("Failed to read DA1 response");
}
tracing::error!("CSI_U: {}", CSI_U.load(Ordering::Relaxed));
tracing::error!("BLINK: {}", BLINK.load(Ordering::Relaxed));
tracing::error!("SHAPE: {}", SHAPE.load(Ordering::Relaxed));
if CSI_U.load(Ordering::Relaxed) {
queue!(
stderr(),
@ -220,6 +226,7 @@ mod cursor {
impl crossterm::Command for RestoreCursor {
fn write_ansi(&self, f: &mut impl std::fmt::Write) -> std::fmt::Result {
let shape = SHAPE.load(Ordering::Relaxed);
tracing::error!("Restoring cursor shape: {}", shape);
match shape {
1 => SetCursorStyle::BlinkingBlock.write_ansi(f)?,
2 => SetCursorStyle::SteadyBlock.write_ansi(f)?,
@ -232,8 +239,10 @@ mod cursor {
let blink = BLINK.load(Ordering::Relaxed);
if blink ^ (shape.max(1) & 1 == 0) {
tracing::error!("Restoring cursor blink1: {}", blink);
EnableBlinking.write_ansi(f)
} else {
tracing::error!("Restoring cursor blink2: {}", blink);
DisableBlinking.write_ansi(f)
}
}