Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / examples / APG / Logging / Use_Syslog.cpp
blobdce9f5d6505879d91368434cd76308d34fa1d538
1 #include "ace/Log_Msg.h"
3 void foo ();
5 int ACE_TMAIN (int, ACE_TCHAR *argv[])
7 // This will be directed to stderr (the default ACE_Log_Msg
8 // behavior).
9 ACE_TRACE ("main");
11 ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%IHi Mom\n")));
13 // Everything from foo() will be directed to the system logger
14 ACE_LOG_MSG->open
15 (argv[0], ACE_Log_Msg::SYSLOG, ACE_TEXT ("syslogTest"));
16 foo ();
18 // Now we reset the log output to default (stderr)
19 ACE_LOG_MSG->open (argv[0]);
20 ACE_DEBUG ((LM_INFO, ACE_TEXT ("%IGoodnight\n")));
22 return 0;
25 void foo ()
27 ACE_TRACE ("foo");
29 ACE_DEBUG ((LM_INFO, ACE_TEXT ("%IHowdy Pardner\n")));