diff --git a/doc/glog.html b/doc/glog.html index b390832..c681609 100644 --- a/doc/glog.html +++ b/doc/glog.html @@ -18,7 +18,7 @@ color: #000; font-family: "Times Roman", times, serif; } - ul.blacklist li { + ul.blacklist li { color: #000; font-family: "Times Roman", times, serif; } @@ -96,7 +96,7 @@ in addition to log files.
Several flags influences glog's output behavior. +
Several flags influence glog's output behavior.
If the Google
gflags library is installed on your machine, the
configure script (see the INSTALL file in the package for
@@ -122,7 +122,7 @@ environment variables, prefixing the flag name with "GLOG_", e.g.
logtostderr (bool, default=false)
true by specifying
-1, true , or yes (case
+1, true, or yes (case
insensitive).
Also, you can set binary flags to false by specifying
0, false, or no (again, case
@@ -131,7 +131,7 @@ insensitive).
is ERROR)
INFO, WARNING, ERROR, and
+INFO, WARNING, ERROR, and
FATAL are 0, 1, 2, and 3, respectively.
minloglevel (int, default=0, which
is INFO)
@@ -168,7 +168,7 @@ conditions. You can use the following macros to perform conditional
logging:
- LOG_IF(INFO, num_cookies > 10) << "Got lots of cookies"; + LOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";The "Got lots of cookies" message is logged only when the variable @@ -176,7 +176,7 @@ The "Got lots of cookies" message is logged only when the variable If a line of code is executed many times, it may be useful to only log a message at certain intervals. This kind of logging is most useful -for informational messages. +for informational messages.
LOG_EVERY_N(INFO, 10) << "Got the " << COUNTER << "th cookie";
@@ -191,7 +191,7 @@ happening.
following macro.
- LOG_IF_EVERY_N(INFO, (size > 1024), 10) << "Got the " << COUNTER
+ LOG_IF_EVERY_N(INFO, (size > 1024), 10) << "Got the " << COUNTER
<< "th big cookie";
@@ -216,14 +216,11 @@ application due to excessive logging.
DLOG(INFO) << "Found cookies";
- DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";
+ DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";
DLOG_EVERY_N(INFO, 10) << "Got the " << COUNTER << "th cookie";
-All "debug mode" logging is compiled away to nothing for non-debug mode
-compiles.
-
CHECK Macros
It is a good practice to check expected conditions in your program
@@ -235,11 +232,11 @@ defined in the standard C library.
CHECK aborts the application if a condition is not
true. Unlike assert, it is *not* controlled by
NDEBUG, so the check will be executed regardless of
-compilation mode. Therefore, fp->Write(x) in the
+compilation mode. Therefore, fp->Write(x) in the
following example is always executed:
- CHECK(fp->Write(x) == 4) << "Write failed!";
+ CHECK(fp->Write(x) == 4) << "Write failed!";
There are various helper macros for
@@ -272,14 +269,14 @@ pointer and the other is NULL. To work around this, simply static_cast
NULL to the type of the desired pointer.
- CHECK_EQ(some_ptr, static_cast(NULL));
+ CHECK_EQ(some_ptr, static_cast<SomeType*>(NULL));
Better yet, use the CHECK_NOTNULL macro:
CHECK_NOTNULL(some_ptr);
- some_ptr->DoSomething();
+ some_ptr->DoSomething();
Since this macro returns the given pointer, this is very useful in
@@ -308,7 +305,7 @@ equal.
Note that both arguments may be temporary strings which are
destructed at the end of the current "full expression"
(e.g., CHECK_STREQ(Foo().c_str(), Bar().c_str()) where
-Foo and Bar returns C++'s
+Foo and Bar return C++'s
std::string).
The CHECK_DOUBLE_EQ macro checks the equality of two
@@ -323,7 +320,7 @@ useful. However, you may want to ignore too verbose messages in usual
development. For such verbose logging, glog provides the
VLOG macro, which allows you to define your own numeric
logging levels. The --v command line option controls
-which verbose messages are logged:
+which verbose messages are logged:
VLOG(1) << "I'm printed when you run the program with --v=1 or higher";
@@ -383,13 +380,13 @@ analogous to LOG_IF, LOG_EVERY_N,
opposed to a severity level.
- VLOG_IF(1, (size > 1024))
+ VLOG_IF(1, (size > 1024))
<< "I'm printed when size is more than 1024 and when you run the "
"program with --v=1 or more";
VLOG_EVERY_N(1, 10)
<< "I'm printed every 10th occurrence, and when you run the program "
"with --v=1 or more. Present occurence is " << COUNTER;
- VLOG_IF_EVERY_N(1, (size > 1024), 10)
+ VLOG_IF_EVERY_N(1, (size > 1024), 10)
<< "I'm printed on every 10th occurence of case when size is more "
" than 1024, when you run the program with --v=1 or more. ";
"Present occurence is " << COUNTER;
@@ -406,7 +403,7 @@ expressions when the conditions are false. So, the following check
may not sacrifice the performance of your application.
- CHECK(obj.ok) << obj.CreatePrettyFormattedStringButVerySlow();
+ CHECK(obj.ok) << obj.CreatePrettyFormattedStringButVerySlow();
User-defined Failure Function
@@ -451,13 +448,13 @@ description of the current state of errno to their output lines.
E.g.
- PCHECK(write(1, NULL, 2) >= 0) << "Write NULL failed";
+ PCHECK(write(1, NULL, 2) >= 0) << "Write NULL failed";
This check fails with the following error message.
- F0825 185142 test.cc:22] Check failed: write(1, NULL, 2) >= 0 Write NULL failed: Bad address [14]
+ F0825 185142 test.cc:22] Check failed: write(1, NULL, 2) >= 0 Write NULL failed: Bad address [14]
Syslog
@@ -484,7 +481,7 @@ the GOOGLE_STRIP_LOG macro:
#include <google/logging.h>
-The compiler will remove the log messages whose severity are less
+
The compiler will remove the log messages whose severities are less
than the specified integer value. Since
VLOG logs at the severity level INFO
(numeric value 0),