mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
e33fd1c780
commit
2af101dd40
3 changed files with 8 additions and 3 deletions
|
|
@ -6,7 +6,7 @@ use ratatui::layout::Rect;
|
|||
use tokio::{io::AsyncWriteExt, process::{Child, Command}, sync::mpsc::{self, UnboundedSender}};
|
||||
use tracing::{debug, warn};
|
||||
use yazi_config::PREVIEW;
|
||||
use yazi_shared::{LOG_LEVEL, LogLevel, RoCell, env_exists};
|
||||
use yazi_shared::{LOG_LEVEL, RoCell, env_exists};
|
||||
|
||||
use crate::{Adapter, Dimension};
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ impl Ueberzug {
|
|||
fn create_demon(adapter: Adapter) -> Result<Child> {
|
||||
let result = Command::new("ueberzugpp")
|
||||
.args(["layer", "-so", &adapter.to_string()])
|
||||
.env("SPDLOG_LEVEL", if LOG_LEVEL.get() != LogLevel::None { "debug" } else { "" })
|
||||
.env("SPDLOG_LEVEL", if LOG_LEVEL.get().is_none() { "" } else { "debug" })
|
||||
.kill_on_drop(true)
|
||||
.stdin(Stdio::piped())
|
||||
.stdout(Stdio::null())
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ pub(super) struct Logs;
|
|||
impl Logs {
|
||||
pub(super) fn start() -> anyhow::Result<()> {
|
||||
let level = LOG_LEVEL.get();
|
||||
if LOG_LEVEL.get() == LogLevel::None {
|
||||
if LOG_LEVEL.get().is_none() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,11 @@ pub enum LogLevel {
|
|||
Debug,
|
||||
}
|
||||
|
||||
impl LogLevel {
|
||||
#[inline]
|
||||
pub fn is_none(self) -> bool { self == Self::None }
|
||||
}
|
||||
|
||||
impl From<String> for LogLevel {
|
||||
fn from(mut s: String) -> Self {
|
||||
s.make_ascii_uppercase();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue