Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / examples / APG / Logging / Use_Multiple_Sinks.cpp
bloba36d42bb5d0d4ff279e909350209e1ef4190c93f
1 #include "ace/Log_Msg.h"
2 #include "ace/streams.h"
4 int ACE_TMAIN (int, ACE_TCHAR *argv[])
6 // Output to default destination (stderr)
7 ACE_LOG_MSG->open (argv[0]);
9 ACE_TRACE ("main");
11 ACE_OSTREAM_TYPE *output =
12 (ACE_OSTREAM_TYPE *) new ofstream ("ostream.output.test");
14 ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%IThis will go to STDERR\n")));
16 ACE_LOG_MSG->open
17 (argv[0], ACE_Log_Msg::SYSLOG, ACE_TEXT ("syslogTest"));
18 ACE_LOG_MSG->set_flags (ACE_Log_Msg::STDERR);
19 ACE_DEBUG
20 ((LM_DEBUG, ACE_TEXT ("%IThis goes to STDERR & syslog\n")));
22 ACE_LOG_MSG->msg_ostream (output, 0);
23 ACE_LOG_MSG->set_flags (ACE_Log_Msg::OSTREAM);
24 ACE_DEBUG ((LM_DEBUG,
25 ACE_TEXT ("%IThis will go to STDERR, ")
26 ACE_TEXT ("syslog & an ostream\n")));
28 ACE_LOG_MSG->clr_flags (ACE_Log_Msg::OSTREAM);
29 delete output;
31 return 0;