Add basic debug logger.
This commit is contained in:
30
qml/Logger/Logger.qml
Normal file
30
qml/Logger/Logger.qml
Normal file
@@ -0,0 +1,30 @@
|
||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
||||
//
|
||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
||||
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
|
||||
QtObject {
|
||||
signal logged(string level, string message)
|
||||
|
||||
function log(msg) {
|
||||
console.log(msg)
|
||||
logged("INFO", msg)
|
||||
}
|
||||
|
||||
function debug(msg) {
|
||||
console.log(msg)
|
||||
logged("DEBUG", msg)
|
||||
}
|
||||
|
||||
function warn(msg) {
|
||||
console.warn(msg)
|
||||
logged("WARN", msg)
|
||||
}
|
||||
|
||||
function error(msg) {
|
||||
console.error(msg)
|
||||
logged("ERROR", msg)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user