Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / examples / APG / Logging / Use_Stderr.cpp
blob807313ca18e1b51e81bc33fae4ced735d6cd609d
1 #include "ace/Log_Msg.h"
3 void foo ();
5 // Listing 1 code/ch03
6 int ACE_TMAIN (int, ACE_TCHAR *argv[])
8 // open() requires the name of the application
9 // (e.g. -- argv[0]) because the underlying
10 // implementation may use it in the log output.
11 ACE_LOG_MSG->open (argv[0], ACE_Log_Msg::STDERR);
12 // Listing 1
14 /* Alternatively, you can use the set_flags() method to do the same
15 thing after the singleton has been created:
18 ACE_TRACE ("main");
20 // Listing 2 code/ch03
21 ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%IHi Mom\n")));
22 ACE_LOG_MSG->set_flags (ACE_Log_Msg::STDERR);
23 foo ();
24 // Listing 2
26 ACE_DEBUG ((LM_INFO, ACE_TEXT ("%IGoodnight\n")));
28 return 0;
31 void foo ()
33 ACE_TRACE ("foo");
35 ACE_DEBUG ((LM_INFO, ACE_TEXT ("%IHowdy Pardner\n")));