Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / examples / APG / Logging / Use_Logging_Strategy.cpp
blob98e2c9db6f1a00a4cc0b701a8032afc24c00fbb3
1 #include "ace/Log_Msg.h"
2 #include "ace/Service_Config.h"
4 /*
5 Put the following in your svc.conf:
7 dynamic Logger Service_Object * ACE:_make_ACE_Logging_Strategy() "-s log.out -f STDERR|OSTREAM -p DEBUG|NOTICE"
9 There seems to be a bug in ACE_Logging_Strategy in that the priority
10 flags are not propagated to spawned threads.
13 // Listing 1 code/ch03
14 int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
16 if (ACE_Service_Config::open (argc,
17 argv,
18 ACE_DEFAULT_LOGGER_KEY,
21 1) < 0)
22 ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"),
23 ACE_TEXT ("Service Config open")),
24 1);
25 ACE_TRACE ("main");
26 ACE_DEBUG ((LM_NOTICE, ACE_TEXT ("%t%IHowdy Pardner\n")));
27 ACE_DEBUG ((LM_INFO, ACE_TEXT ("%t%IGoodnight\n")));
29 return 0;
31 // Listing 1