Add google:: prefixes for COUNTER in glog's document
http://code.google.com/p/google-glog/issues/detail?id=92 git-svn-id: https://google-glog.googlecode.com/svn/trunk@95 eb4d4688-79bd-11dd-afb4-1d65580434c0
This commit is contained in:
parent
54421697f4
commit
b1afbe7b3c
@ -186,19 +186,19 @@ a message at certain intervals. This kind of logging is most useful
|
||||
for informational messages.
|
||||
|
||||
<pre>
|
||||
LOG_EVERY_N(INFO, 10) << "Got the " << COUNTER << "th cookie";
|
||||
LOG_EVERY_N(INFO, 10) << "Got the " << google::COUNTER << "th cookie";
|
||||
</pre>
|
||||
|
||||
<p>The above line outputs a log messages on the 1st, 11th,
|
||||
21st, ... times it is executed. Note that the special
|
||||
<code>COUNTER</code> value is used to identify which repetition is
|
||||
<code>google::COUNTER</code> value is used to identify which repetition is
|
||||
happening.
|
||||
|
||||
<p>You can combine conditional and occasional logging with the
|
||||
following macro.
|
||||
|
||||
<pre>
|
||||
LOG_IF_EVERY_N(INFO, (size > 1024), 10) << "Got the " << COUNTER
|
||||
LOG_IF_EVERY_N(INFO, (size > 1024), 10) << "Got the " << google::COUNTER
|
||||
<< "th big cookie";
|
||||
</pre>
|
||||
|
||||
@ -206,11 +206,11 @@ following macro.
|
||||
the output to the first n occurrences:
|
||||
|
||||
<pre>
|
||||
LOG_FIRST_N(INFO, 20) << "Got the " << COUNTER << "th cookie";
|
||||
LOG_FIRST_N(INFO, 20) << "Got the " << google::COUNTER << "th cookie";
|
||||
</pre>
|
||||
|
||||
<p>Outputs log messages for the first 20 times it is executed. Again,
|
||||
the <code>COUNTER</code> identifier indicates which repetition is
|
||||
the <code>google::COUNTER</code> identifier indicates which repetition is
|
||||
happening.
|
||||
|
||||
<h2><A NAME=debug>Debug Mode Support</A></h2>
|
||||
@ -225,7 +225,7 @@ application due to excessive logging.
|
||||
|
||||
DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";
|
||||
|
||||
DLOG_EVERY_N(INFO, 10) << "Got the " << COUNTER << "th cookie";
|
||||
DLOG_EVERY_N(INFO, 10) << "Got the " << google::COUNTER << "th cookie";
|
||||
</pre>
|
||||
|
||||
<h2><A NAME=check>CHECK Macros</A></h2>
|
||||
@ -392,11 +392,11 @@ opposed to a severity level.
|
||||
"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;
|
||||
"with --v=1 or more. Present occurence is " << google::COUNTER;
|
||||
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;
|
||||
"Present occurence is " << google::COUNTER;
|
||||
</pre>
|
||||
|
||||
<h2> <A name="signal">Failure Signal Handler</A> </h2>
|
||||
|
||||
@ -152,21 +152,21 @@ typedef unsigned __int64 uint64;
|
||||
// You can also do occasional logging (log every n'th occurrence of an
|
||||
// event):
|
||||
//
|
||||
// LOG_EVERY_N(INFO, 10) << "Got the " << COUNTER << "th cookie";
|
||||
// LOG_EVERY_N(INFO, 10) << "Got the " << google::COUNTER << "th cookie";
|
||||
//
|
||||
// The above will cause log messages to be output on the 1st, 11th, 21st, ...
|
||||
// times it is executed. Note that the special COUNTER value is used to
|
||||
// identify which repetition is happening.
|
||||
// times it is executed. Note that the special google::COUNTER value is used
|
||||
// to identify which repetition is happening.
|
||||
//
|
||||
// You can also do occasional conditional logging (log every n'th
|
||||
// occurrence of an event, when condition is satisfied):
|
||||
//
|
||||
// LOG_IF_EVERY_N(INFO, (size > 1024), 10) << "Got the " << COUNTER
|
||||
// LOG_IF_EVERY_N(INFO, (size > 1024), 10) << "Got the " << google::COUNTER
|
||||
// << "th big cookie";
|
||||
//
|
||||
// You can log messages the first N times your code executes a line. E.g.
|
||||
//
|
||||
// LOG_FIRST_N(INFO, 20) << "Got the " << COUNTER << "th cookie";
|
||||
// LOG_FIRST_N(INFO, 20) << "Got the " << google::COUNTER << "th cookie";
|
||||
//
|
||||
// Outputs log messages for the first 20 times it is executed.
|
||||
//
|
||||
@ -183,7 +183,7 @@ typedef unsigned __int64 uint64;
|
||||
//
|
||||
// DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";
|
||||
//
|
||||
// DLOG_EVERY_N(INFO, 10) << "Got the " << COUNTER << "th cookie";
|
||||
// DLOG_EVERY_N(INFO, 10) << "Got the " << google::COUNTER << "th cookie";
|
||||
//
|
||||
// All "debug mode" logging is compiled away to nothing for non-debug mode
|
||||
// compiles.
|
||||
@ -227,11 +227,11 @@ typedef unsigned __int64 uint64;
|
||||
// "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;
|
||||
// "with --v=1 or more. Present occurence is " << google::COUNTER;
|
||||
// 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;
|
||||
// "Present occurence is " << google::COUNTER;
|
||||
//
|
||||
// The supported severity levels for macros that allow you to specify one
|
||||
// are (in increasing order of severity) INFO, WARNING, ERROR, and FATAL.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user