Commit fd6baebf authored by Davis King's avatar Davis King

Added some more comments to this example.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402672
parent 0b3cf015
......@@ -107,7 +107,7 @@ int main()
{
setup_loggers();
// print our first message. It will go to cout because that is the defaul.
// print our first message. It will go to cout because that is the default.
logp << LINFO << "This is an informational message.";
int variable = 8;
......@@ -134,6 +134,14 @@ int main()
logp << LINFO << "program ending";
// It is also worth pointing out that the logger messages are atomic. This means, for example, that
// in the above log statements that involve a string literal and a variable, no other thread can
// come in and print a log message in-between the literal string and the variable. This is good
// because it means your messages don't get corrupted. However, this also means that you shouldn't
// make any function calls inside a logging statement if those calls might try to log a message
// themselves since the atomic nature of the logger would cause your application to deadlock.
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment