summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
author <shinichiro.hamaji@gmail.com>2012-01-11 09:17:04 +0000
committer <shinichiro.hamaji@gmail.com>2012-01-11 09:17:04 +0000
commit6febec361e73860cc77d9cb0c6c14013c0e36ef0 (patch)
tree0a70877621ee65eaea5843ea104555217f05cedc /doc
parent8a4c1663e32133cd0e1f275c32f4dd1ba701a61d (diff)
downloadglog-6febec361e73860cc77d9cb0c6c14013c0e36ef0.tar.gz
glog-6febec361e73860cc77d9cb0c6c14013c0e36ef0.tar.bz2
glog-6febec361e73860cc77d9cb0c6c14013c0e36ef0.zip
Define GLOG_ prefixed log severities
Users can control if usual log severity values will be defined by GLOG_NO_ABBREVIATED_SEVERITIES. For http://code.google.com/p/google-glog/issues/detail?id=105 git-svn-id: https://google-glog.googlecode.com/svn/trunk@101 eb4d4688-79bd-11dd-afb4-1d65580434c0
Diffstat (limited to 'doc')
-rw-r--r--doc/glog.html44
1 files changed, 42 insertions, 2 deletions
diff --git a/doc/glog.html b/doc/glog.html
index a2d093d..a104659 100644
--- a/doc/glog.html
+++ b/doc/glog.html
@@ -527,8 +527,48 @@ all log messages associated with <code>VLOG</code>s as well as
<h3><A NAME=windows>Notes for Windows users</A></h3>
<p>Google glog defines a severity level <code>ERROR</code>, which is
-also defined in <code>windows.h</code>
-There are two known workarounds to avoid this conflict:
+also defined in <code>windows.h</code> . You can make glog not define
+<code>INFO</code>, <code>WARNING</code>, <code>ERROR</code>,
+and <code>FATAL</code> by defining
+<code>GLOG_NO_ABBREVIATED_SEVERITIES</code> before
+including <code>glog/logging.h</code> . Even with this macro, you can
+still use the iostream like logging facilities:
+
+<pre>
+ #define GLOG_NO_ABBREVIATED_SEVERITIES
+ #include &lt;windows.h&gt;
+ #include &lt;glog/logging.h&gt;
+
+ // ...
+
+ LOG(ERROR) &lt;&lt; "This should work";
+ LOG_IF(ERROR, x &gt; y) &lt;&lt; "This should be also OK";
+</pre>
+
+<p>
+However, you cannot
+use <code>INFO</code>, <code>WARNING</code>, <code>ERROR</code>,
+and <code>FATAL</code> anymore for functions defined
+in <code>glog/logging.h</code> .
+
+<pre>
+ #define GLOG_NO_ABBREVIATED_SEVERITIES
+ #include &lt;windows.h&gt;
+ #include &lt;glog/logging.h&gt;
+
+ // ...
+
+ // This won't work.
+ // google::FlushLogFiles(google::ERROR);
+
+ // Use this instead.
+ google::FlushLogFiles(google::GLOG_ERROR);
+</pre>
+
+<p>
+If you don't need <code>ERROR</code> defined
+by <code>windows.h</code>, there are a couple of more workarounds
+which sometimes don't work:
<ul>
<li>#define <code>WIN32_LEAN_AND_MEAN</code> or <code>NOGDI</code>