Add trace logs.

This commit is contained in:
2026-02-02 18:01:53 -05:00
parent e5b91eaed8
commit 5af09485a3
6 changed files with 24 additions and 12 deletions

View File

@@ -204,7 +204,10 @@ SplitView {
Component.onCompleted: { Component.onCompleted: {
// Show logging is working. // Show logging is working.
Logger.debug("Debug console ready") Logger.info("Info logs")
Logger.warn("Warnings show up too") Logger.warn("Warning logs")
Logger.debug("Debug logs")
Logger.error("Error logs")
Logger.trace("Trace logs")
} }
} }

View File

@@ -26,19 +26,16 @@ Item {
switch (level) { switch (level) {
case "INFO": case "INFO":
return RustColors.info_log return RustColors.info_log
break;
case "DEBUG": case "DEBUG":
return RustColors.debug_log return RustColors.debug_log
break;
case "WARN": case "WARN":
return RustColors.warn_log return RustColors.warn_log
break;
case "ERROR": case "ERROR":
return RustColors.error_log return RustColors.error_log
break; case "TRACE":
return RustColors.trace_log
default: default:
return RustColors.info_log return RustColors.info_log
break;
} }
} }

View File

@@ -88,7 +88,7 @@ SplitView {
originalRootDirectory: root.projectDir originalRootDirectory: root.projectDir
rootDirectory: root.projectDir rootDirectory: root.projectDir
onRootDirectoryChanged: { onRootDirectoryChanged: {
Logger.log(clideTreeView.rootDirectory) Logger.log("Setting root directory: " + clideTreeView.rootDirectory)
breadCrumb.text = clideTreeView.rootDirectory breadCrumb.text = clideTreeView.rootDirectory
} }
} }

View File

@@ -48,9 +48,8 @@ TreeView {
if (treeDelegate.hasChildren) { if (treeDelegate.hasChildren) {
return treeDelegate.expanded ? return treeDelegate.expanded ?
folderOpen : folderClosed; folderOpen : folderClosed;
} else {
return file
} }
return file
} }
x: treeDelegate.leftMargin + (treeDelegate.depth * treeDelegate.indentation) x: treeDelegate.leftMargin + (treeDelegate.depth * treeDelegate.indentation)

View File

@@ -13,6 +13,11 @@ QtObject {
logged("INFO", msg) logged("INFO", msg)
} }
function info(msg) {
console.log(msg)
logged("INFO", msg)
}
function debug(msg) { function debug(msg) {
console.log(msg) console.log(msg)
logged("DEBUG", msg) logged("DEBUG", msg)
@@ -27,4 +32,9 @@ QtObject {
console.error(msg) console.error(msg)
logged("ERROR", msg) logged("ERROR", msg)
} }
function trace(msg) {
console.log(msg)
logged("TRACE", msg)
}
} }

View File

@@ -41,6 +41,7 @@ pub mod qobject {
#[qproperty(QColor, debug_log)] #[qproperty(QColor, debug_log)]
#[qproperty(QColor, warn_log)] #[qproperty(QColor, warn_log)]
#[qproperty(QColor, error_log)] #[qproperty(QColor, error_log)]
#[qproperty(QColor, trace_log)]
type RustColors = super::RustColorsImpl; type RustColors = super::RustColorsImpl;
} }
} }
@@ -75,6 +76,7 @@ pub struct RustColorsImpl {
debug_log: QColor, debug_log: QColor,
warn_log: QColor, warn_log: QColor,
error_log: QColor, error_log: QColor,
trace_log: QColor,
} }
impl Default for RustColorsImpl { impl Default for RustColorsImpl {
@@ -104,9 +106,10 @@ impl Default for RustColorsImpl {
explorer_folder_open: QColor::try_from("#2b2b2b").unwrap(), explorer_folder_open: QColor::try_from("#2b2b2b").unwrap(),
terminal_background: QColor::try_from("#111111").unwrap(), terminal_background: QColor::try_from("#111111").unwrap(),
info_log: QColor::try_from("#C4FFFF").unwrap(), info_log: QColor::try_from("#C4FFFF").unwrap(),
debug_log: QColor::try_from("#55ff99").unwrap(), debug_log: QColor::try_from("#9148AF").unwrap(),
warn_log: QColor::try_from("#ffaa00").unwrap(), warn_log: QColor::try_from("#C4A958").unwrap(),
error_log: QColor::try_from("#ff5555").unwrap(), error_log: QColor::try_from("#ff5555").unwrap(),
trace_log: QColor::try_from("#ffaa00").unwrap(),
} }
} }
} }