Add trace logs.
This commit is contained in:
@@ -204,7 +204,10 @@ SplitView {
|
||||
|
||||
Component.onCompleted: {
|
||||
// Show logging is working.
|
||||
Logger.debug("Debug console ready")
|
||||
Logger.warn("Warnings show up too")
|
||||
Logger.info("Info logs")
|
||||
Logger.warn("Warning logs")
|
||||
Logger.debug("Debug logs")
|
||||
Logger.error("Error logs")
|
||||
Logger.trace("Trace logs")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,19 +26,16 @@ Item {
|
||||
switch (level) {
|
||||
case "INFO":
|
||||
return RustColors.info_log
|
||||
break;
|
||||
case "DEBUG":
|
||||
return RustColors.debug_log
|
||||
break;
|
||||
case "WARN":
|
||||
return RustColors.warn_log
|
||||
break;
|
||||
case "ERROR":
|
||||
return RustColors.error_log
|
||||
break;
|
||||
case "TRACE":
|
||||
return RustColors.trace_log
|
||||
default:
|
||||
return RustColors.info_log
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ SplitView {
|
||||
originalRootDirectory: root.projectDir
|
||||
rootDirectory: root.projectDir
|
||||
onRootDirectoryChanged: {
|
||||
Logger.log(clideTreeView.rootDirectory)
|
||||
Logger.log("Setting root directory: " + clideTreeView.rootDirectory)
|
||||
breadCrumb.text = clideTreeView.rootDirectory
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,9 +48,8 @@ TreeView {
|
||||
if (treeDelegate.hasChildren) {
|
||||
return treeDelegate.expanded ?
|
||||
folderOpen : folderClosed;
|
||||
} else {
|
||||
return file
|
||||
}
|
||||
return file
|
||||
}
|
||||
|
||||
x: treeDelegate.leftMargin + (treeDelegate.depth * treeDelegate.indentation)
|
||||
|
||||
@@ -13,6 +13,11 @@ QtObject {
|
||||
logged("INFO", msg)
|
||||
}
|
||||
|
||||
function info(msg) {
|
||||
console.log(msg)
|
||||
logged("INFO", msg)
|
||||
}
|
||||
|
||||
function debug(msg) {
|
||||
console.log(msg)
|
||||
logged("DEBUG", msg)
|
||||
@@ -27,4 +32,9 @@ QtObject {
|
||||
console.error(msg)
|
||||
logged("ERROR", msg)
|
||||
}
|
||||
|
||||
function trace(msg) {
|
||||
console.log(msg)
|
||||
logged("TRACE", msg)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ pub mod qobject {
|
||||
#[qproperty(QColor, debug_log)]
|
||||
#[qproperty(QColor, warn_log)]
|
||||
#[qproperty(QColor, error_log)]
|
||||
#[qproperty(QColor, trace_log)]
|
||||
type RustColors = super::RustColorsImpl;
|
||||
}
|
||||
}
|
||||
@@ -75,6 +76,7 @@ pub struct RustColorsImpl {
|
||||
debug_log: QColor,
|
||||
warn_log: QColor,
|
||||
error_log: QColor,
|
||||
trace_log: QColor,
|
||||
}
|
||||
|
||||
impl Default for RustColorsImpl {
|
||||
@@ -104,9 +106,10 @@ impl Default for RustColorsImpl {
|
||||
explorer_folder_open: QColor::try_from("#2b2b2b").unwrap(),
|
||||
terminal_background: QColor::try_from("#111111").unwrap(),
|
||||
info_log: QColor::try_from("#C4FFFF").unwrap(),
|
||||
debug_log: QColor::try_from("#55ff99").unwrap(),
|
||||
warn_log: QColor::try_from("#ffaa00").unwrap(),
|
||||
debug_log: QColor::try_from("#9148AF").unwrap(),
|
||||
warn_log: QColor::try_from("#C4A958").unwrap(),
|
||||
error_log: QColor::try_from("#ff5555").unwrap(),
|
||||
trace_log: QColor::try_from("#ffaa00").unwrap(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user