Skip to content

Commit

Permalink
Merge branch 'master' into mynamebyebye
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteven4 committed Nov 6, 2024
2 parents 400dcfb + dfadba0 commit ddbe287
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/core/logging.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#include "src/core/logging.h"


QDebug operator<< (QDebug debug, const DebugIndent& indent)
QDebug& operator<< (QDebug& debug, const DebugIndent& indent)
{
for (int i = 1; i<indent.level; i++) {
for (int i = 1; i<indent.level_; i++) {
debug << '.';
}
return debug;
Expand Down
10 changes: 6 additions & 4 deletions src/core/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,20 @@ class FatalMsg : public QDebug
class DebugIndent
{
public:
explicit DebugIndent(int l) : level(l) {}
explicit DebugIndent(int level) : level_(level) {}
friend QDebug& operator<<(QDebug& debug, const DebugIndent& indent);

int level;
private:
int level_;
};

QDebug operator<< (QDebug debug, const DebugIndent& indent);
QDebug& operator<< (QDebug& debug, const DebugIndent& indent);

class Debug : public QDebug
{
public:
Debug() : QDebug(QtDebugMsg) {nospace().noquote();}
explicit Debug(int l) : QDebug(QtDebugMsg) {nospace().noquote() << DebugIndent(l);}
explicit Debug(int level) : QDebug(QtDebugMsg) {nospace().noquote() << DebugIndent(level);}
};

#endif // SRC_CORE_LOGGING_H_

0 comments on commit ddbe287

Please sign in to comment.