@@ -65,7 +65,7 @@ LogSeverity getMinLogLevel();
65
65
// This means LOG(severity) should expand to something that can take
66
66
// << operators on its right hand side. This is achieved with the
67
67
// ternary '? :', as implemented by this helper macro.
68
- //
68
+ //
69
69
// Unfortunately, a simple thing like:
70
70
//
71
71
// !(condition) ? (void)0 : (expr)
@@ -93,7 +93,7 @@ LogSeverity getMinLogLevel();
93
93
#define LOG (severity ) \
94
94
LOG_LAZY_EVAL (LOG_IS_ON(severity), \
95
95
LOG_MESSAGE_STREAM_COMPACT(severity))
96
-
96
+
97
97
// A variant of LOG() that only performs logging if a specific condition
98
98
// is encountered. Note that |condition| is only evaluated if |severity|
99
99
// is high enough. Usage example:
@@ -124,7 +124,7 @@ LogSeverity getMinLogLevel();
124
124
#define PLOG_IF (severity, condition ) \
125
125
LOG_LAZY_EVAL (LOG_IS_ON(severity) && (condition), \
126
126
PLOG_MESSAGE_STREAM_COMPACT(severity))
127
-
127
+
128
128
// Evaluate |condition|, and if it fails, log a fatal message.
129
129
// This is a better version of assert(), in the future, this will
130
130
// also break directly into the debugger for debug builds.
@@ -166,7 +166,7 @@ LogSeverity getMinLogLevel();
166
166
# define ENABLE_DCHECK 2
167
167
# endif
168
168
#endif
169
-
169
+
170
170
// DLOG_IS_ON(severity) is used to indicate whether DLOG() should print
171
171
// something for the current level.
172
172
#if ENABLE_DLOG
@@ -176,7 +176,7 @@ LogSeverity getMinLogLevel();
176
176
// not compiled in the final binary.
177
177
# define DLOG_IS_ON (severity ) false
178
178
#endif
179
-
179
+
180
180
// DCHECK_IS_ON() is used to indicate whether DCHECK() should do anything.
181
181
#if ENABLE_DCHECK == 0
182
182
// NOTE: Compile-time constant ensures the DCHECK() statements are
@@ -212,7 +212,7 @@ bool setDcheckLevel(bool enabled);
212
212
#define DCHECK (condition ) \
213
213
LOG_IF (FATAL, DCHECK_IS_ON() && !(condition)) \
214
214
<< "Check failed: " #condition " . "
215
-
215
+
216
216
// Convenience class used hold a formatted string for logging reasons.
217
217
// Usage example:
218
218
//
@@ -251,7 +251,7 @@ class LogStream {
251
251
public:
252
252
LogStream (const char * file, int lineno, LogSeverity severity);
253
253
~LogStream ();
254
-
254
+
255
255
inline LogStream& operator <<(const char * str) {
256
256
append (str);
257
257
return *this ;
@@ -275,7 +275,7 @@ class LogStream {
275
275
LogStream& operator <<(unsigned long long v);
276
276
LogStream& operator <<(float v);
277
277
LogStream& operator <<(double v);
278
-
278
+
279
279
const char * string () const { return mString ? mString : " " ; }
280
280
size_t size () const { return mSize ; }
281
281
const LogParams& params () const { return mParams ; }
@@ -347,7 +347,7 @@ class ErrnoLogMessage {
347
347
LogSeverity severity,
348
348
int errnoCode);
349
349
~ErrnoLogMessage ();
350
-
350
+
351
351
LogStream& stream () const { return *mStream ; }
352
352
private:
353
353
LogStream* mStream ;
@@ -370,10 +370,10 @@ namespace testing {
370
370
// Abstract interface to the output where the log messages are sent.
371
371
// IMPORTANT: Only use this for unit testing the log facility.
372
372
class LogOutput {
373
- public:
373
+ public:
374
374
LogOutput () {}
375
375
virtual ~LogOutput () {}
376
-
376
+
377
377
// Send a full log message to the output. Not zero terminated, and
378
378
// Does not have a trailing \n which can be added by the implementation
379
379
// when writing the message to a file.
@@ -382,7 +382,7 @@ class LogOutput {
382
382
virtual void logMessage (const LogParams& params,
383
383
const char * message,
384
384
size_t message_len) = 0;
385
-
385
+
386
386
// Set a new log output, and return pointer to the previous
387
387
// implementation, which will be NULL for the default one.
388
388
// |newOutput| is either NULL (which means the default), or a
0 commit comments