Skip to content

Commit 00be844

Browse files
committed
Enhance logging output with colored formatting for better visibility
1 parent 9b33f41 commit 00be844

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/Logger.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,27 @@ class Logger {
99

1010
// Always show info messages (connection status, etc.)
1111
static void info(const QString& message) {
12-
qInfo() << "INFO:" << message;
12+
// Cyan
13+
qInfo().noquote() << "\033[36m[INFO]\033[0m" << message;
1314
}
14-
15+
1516
// Only show debug messages if verbose mode is enabled
1617
static void debug(const QString& message) {
1718
if (verboseMode) {
18-
qDebug() << "DEBUG:" << message;
19+
// Green
20+
qDebug().noquote() << "\033[32m[DEBUG]\033[0m" << message;
1921
}
2022
}
21-
23+
2224
// Always show warnings and errors
2325
static void warning(const QString& message) {
24-
qWarning() << "WARNING:" << message;
26+
// Yellow
27+
qWarning().noquote() << "\033[33m[WARNING]\033[0m" << message;
2528
}
26-
29+
2730
static void error(const QString& message) {
28-
qCritical() << "ERROR:" << message;
31+
// Red
32+
qCritical().noquote() << "\033[31m[ERROR]\033[0m" << message;
2933
}
3034

3135
static void setVerbose(bool enabled) {

0 commit comments

Comments
 (0)