TreeFrogFramework: src/tdebug.h Source File

1#pragma once

3#include <QString>

4#include <QTextStream>

5#include <QtCore>

6#include <TGlobal>

7

9

17

18

20public:

22 msgPriority(priority) {}

26

33

40

41 inline TDebug &operator<<(QChar t)

42 {

43 ts << t;

44 return *this;

45 }

47 {

48 ts << (t ? "true" : "false");

49 return *this;

50 }

52 {

53 ts << t;

54 return *this;

55 }

57 {

58 ts << t;

59 return *this;

60 }

62 {

63 ts << t;

64 return *this;

65 }

67 {

68 ts << t;

69 return *this;

70 }

72 {

73 ts << t;

74 return *this;

75 }

77 {

78 ts << t;

79 return *this;

80 }

82 {

83 ts << t;

84 return *this;

85 }

87 {

88 ts << t;

89 return *this;

90 }

92 {

93 ts << t;

94 return *this;

95 }

97 {

98 ts << t;

99 return *this;

100 }

102 {

103 ts << t;

104 return *this;

105 }

107 {

108 ts << t;

109 return *this;

110 }

112 {

113 ts << t;

114 return *this;

115 }

117 {

118 ts << t;

119 return *this;

120 }

122 {

123 QString str;

124 for (auto &s : t) {

125 str += "\"";

126 str += s;

127 str += "\", ";

128 }

129 str.chop(2);

130 ts << "[" << str << "]";

131 return *this;

132 }

134 {

135 ts << t;

136 return *this;

137 }

139 {

140 QByteArray str;

141 for (auto &s : t) {

142 str += "\"";

143 str += s;

144 str += "\", ";

145 }

146 str.chop(2);

147 ts << '[' << str << ']';

148 return *this;

149 }

151 {

152 ts << t.toString();

153 return *this;

154 }

156 {

157 ts << t;

158 return *this;

159 }

161 {

162 ts << "(nullptr)";

163 return *this;

164 }

165

166private:

167 QString buffer;

169 int msgPriority {0};

170};

The TDebug class provides a file output stream for debugging information.

Definition tdebug.h:19

TDebug & operator<<(bool t)

Definition tdebug.h:46

TDebug & operator<<(double t)

Definition tdebug.h:101

TDebug & operator<<(quint64 t)

Definition tdebug.h:91

TDebug & operator<<(char t)

Definition tdebug.h:51

TDebug & operator<<(unsigned int t)

Definition tdebug.h:71

TDebug fatal() const

Definition tdebug.h:27

TDebug & operator<<(int t)

Definition tdebug.h:66

TDebug & operator<<(const QVariant &t)

Definition tdebug.h:150

TDebug error() const

Definition tdebug.h:28

TDebug & operator<<(short t)

Definition tdebug.h:56

TDebug trace() const

Definition tdebug.h:32

TDebug & operator<<(const QByteArray &t)

Definition tdebug.h:133

TDebug & operator<<(const QString &t)

Definition tdebug.h:111

TDebug info() const

Definition tdebug.h:30

TDebug & operator<<(unsigned long t)

Definition tdebug.h:81

TDebug & operator<<(const char *t)

Definition tdebug.h:106

TDebug & operator<<(qint64 t)

Definition tdebug.h:86

TDebug & operator<<(std::nullptr_t)

Definition tdebug.h:160

TDebug & operator<<(unsigned short t)

Definition tdebug.h:61

TDebug & operator<<(float t)

Definition tdebug.h:96

TDebug & operator<<(const QLatin1String &t)

Definition tdebug.h:116

TDebug warn() const

Definition tdebug.h:29

TDebug(int priority)

Definition tdebug.h:21

TDebug & operator<<(const void *t)

Definition tdebug.h:155

TDebug debug() const

Definition tdebug.h:31

TDebug & operator<<(const QByteArrayList &t)

Definition tdebug.h:138

TDebug & operator<<(long t)

Definition tdebug.h:76

TDebug & operator<<(const QStringList &t)

Definition tdebug.h:121

The TLogger class provides an abstract base of logging functionality.

Definition tlogger.h:19

The Tf namespace contains miscellaneous identifiers used throughout the library of TreeFrog Framework...

Definition tdebug.h:10

T_CORE_EXPORT void releaseAppLoggers()

Releases all the loggers.

Definition tdebug.cpp:87

T_CORE_EXPORT void setupAppLoggers(TLogger *logger=nullptr)

Sets up all the loggers set in the logger.ini.

Definition tdebug.cpp:51

constexpr auto WriteOnly

Definition tfnamespace.h:258

@ TraceLevel

Finer-grained informational events than the DEBUG.

Definition tfnamespace.h:236

@ WarnLevel

Potentially harmful situations.

Definition tfnamespace.h:233

@ DebugLevel

Informational events that are most useful to debug the app.

Definition tfnamespace.h:235

@ InfoLevel

Informational messages that highlight the progress of the app.

Definition tfnamespace.h:234

@ FatalLevel

Severe error events that will presumably lead the app to abort.

Definition tfnamespace.h:231

@ ErrorLevel

Error events that might still allow the app to continue running.

Definition tfnamespace.h:232

T_CORE_EXPORT void logging(int priority, const QByteArray &msg)

Definition tdebug.cpp:99

#define T_CORE_EXPORT

Definition tdeclexport.h:28

#define T_ATTRIBUTE_FORMAT(A, B)

Definition tglobal.h:43