diff options
author | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-05-18 17:31:15 +0000 |
---|---|---|
committer | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-05-18 17:31:15 +0000 |
commit | 79d57cbb208dcbce8b2a86f73a41a376e7584d73 (patch) | |
tree | eccd4efaecb7048f3bca605e7aa438fb886bf128 /ace | |
parent | 97f558b5360f8c5327777d49a364abca1b68dd5a (diff) | |
download | ATCD-79d57cbb208dcbce8b2a86f73a41a376e7584d73.tar.gz |
Changed Service Configurator so debug messages are only outputted when a
debug flag is used.
Diffstat (limited to 'ace')
-rw-r--r-- | ace/Parse_Node.cpp | 66 | ||||
-rw-r--r-- | ace/Service_Config.cpp | 12 | ||||
-rw-r--r-- | ace/Service_Config.h | 4 | ||||
-rw-r--r-- | ace/Service_Config.i | 6 |
4 files changed, 55 insertions, 33 deletions
diff --git a/ace/Parse_Node.cpp b/ace/Parse_Node.cpp index 42c556ea43b..a27b27199bb 100644 --- a/ace/Parse_Node.cpp +++ b/ace/Parse_Node.cpp @@ -37,9 +37,10 @@ ACE_Stream_Node::apply (void) this->node_->parameters ()) == -1) ace_yyerrno++; - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("did stream on %s, error = %d\n"), - this->node_->name (), - ace_yyerrno)); + if (ACE_Service_Config::debug ()) + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("did stream on %s, error = %d\n"), + this->node_->name (), + ace_yyerrno)); } ACE_ALLOC_HOOK_DEFINE(ACE_Parse_Node) @@ -107,9 +108,10 @@ ACE_Parse_Node::print (void) const { ACE_TRACE ("ACE_Parse_Node::print"); - ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("svc = %s\n"), - this->name ())); + if (ACE_Service_Config::debug ()) + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("svc = %s\n"), + this->name ())); if (this->next_) this->next_->print (); @@ -158,9 +160,10 @@ ACE_Suspend_Node::apply (void) if (ACE_Service_Config::suspend (this->name ()) == -1) ace_yyerrno++; - ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("did suspend on %s, error = %d\n"), - this->name (), ace_yyerrno)); + if (ACE_Service_Config::debug ()) + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("did suspend on %s, error = %d\n"), + this->name (), ace_yyerrno)); } void @@ -170,10 +173,11 @@ ACE_Resume_Node::apply (void) if (ACE_Service_Config::resume (this->name ()) == -1) ace_yyerrno++; - ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("did resume on %s, error = %d\n"), - this->name (), - ace_yyerrno)); + if (ACE_Service_Config::debug ()) + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("did resume on %s, error = %d\n"), + this->name (), + ace_yyerrno)); } ACE_ALLOC_HOOK_DEFINE(ACE_Remove_Node) @@ -197,10 +201,11 @@ ACE_Remove_Node::apply (void) if (ACE_Service_Config::remove (this->name ()) == -1) ace_yyerrno++; - ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("did remove on %s, error = %d\n"), - this->name (), - ace_yyerrno)); + if (ACE_Service_Config::debug ()) + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("did remove on %s, error = %d\n"), + this->name (), + ace_yyerrno)); } @@ -228,10 +233,11 @@ ACE_Dynamic_Node::apply (void) this->parameters ()) == -1) ace_yyerrno++; - ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("did dynamic on %s, error = %d\n"), - this->name (), - ace_yyerrno)); + if (ACE_Service_Config::debug ()) + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("did dynamic on %s, error = %d\n"), + this->name (), + ace_yyerrno)); } ACE_ALLOC_HOOK_DEFINE(ACE_Dynamic_Node) @@ -291,10 +297,11 @@ ACE_Static_Node::apply (void) this->parameters ()) == -1) ace_yyerrno++; - ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("did static on %s, error = %d\n"), - this->name (), - ace_yyerrno)); + if (ACE_Service_Config::debug ()) + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("did static on %s, error = %d\n"), + this->name (), + ace_yyerrno)); } @@ -576,10 +583,11 @@ void ACE_Dummy_Node::apply (void) { ACE_TRACE ("ACE_Dummy_Node::apply"); - ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("did operations on stream %s, error = %d\n"), - this->name (), - ace_yyerrno)); + if (ACE_Service_Config::debug ()) + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("did operations on stream %s, error = %d\n"), + this->name (), + ace_yyerrno)); } ACE_Dummy_Node::~ACE_Dummy_Node (void) diff --git a/ace/Service_Config.cpp b/ace/Service_Config.cpp index e99153b6a1f..a2730e2debc 100644 --- a/ace/Service_Config.cpp +++ b/ace/Service_Config.cpp @@ -268,7 +268,8 @@ ACE_Service_Config::initialize (const ASYS_TCHAR svc_name[], ACE_ARGV args (parameters); ACE_Service_Type *srp = 0; - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("opening static service %s\n"), svc_name)); + if (ACE_Service_Config::debug_) + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("opening static service %s\n"), svc_name)); if (ACE_Service_Repository::instance ()->find (svc_name, (const ACE_Service_Type **) &srp) == -1) @@ -294,7 +295,8 @@ ACE_Service_Config::initialize (const ACE_Service_Type *sr, ACE_TRACE ("ACE_Service_Config::initialize"); ACE_ARGV args (parameters); - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("opening dynamic service %s\n"), sr->name ())); + if (ACE_Service_Config::debug_) + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("opening dynamic service %s\n"), sr->name ())); if (ACE_Service_Repository::instance ()->insert (sr) == -1) ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("insertion failed, %p\n"), sr->name ()), -1); @@ -482,7 +484,8 @@ ACE_Service_Config::open (const ASYS_TCHAR program_name[], return -1; else { - ACE_DEBUG ((LM_STARTUP, ASYS_TEXT ("starting up daemon %n\n"))); + if (ACE_Service_Config::debug_) + ACE_DEBUG ((LM_STARTUP, ASYS_TEXT ("starting up daemon %n\n"))); // Initialize the Service Repository (this will still work if // user forgets to define an object of type ACE_Service_Config). @@ -546,7 +549,8 @@ ACE_Service_Config::reconfigure (void) if (ACE_Service_Config::debug_) { time_t t = ACE_OS::time (0); - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("beginning reconfiguration at %s"), ACE_OS::ctime (&t))); + if (ACE_Service_Config::debug_) + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("beginning reconfiguration at %s"), ACE_OS::ctime (&t))); } if (ACE_Service_Config::process_directives () == -1) diff --git a/ace/Service_Config.h b/ace/Service_Config.h index 88a96335b14..cdb9d7ff816 100644 --- a/ace/Service_Config.h +++ b/ace/Service_Config.h @@ -252,6 +252,9 @@ public: // Totally remove <svc_name> from the daemon by removing it // from the ACE_Reactor, and unlinking it if necessary. + static char debug (void); + // Returns the debug level. + #if defined (ACE_HAS_WINCE) // We must provide these function to bridge the <Svc_Conf> parser // with ACE. @@ -301,6 +304,7 @@ protected: static int load_static_svcs (void); // Add the default statically-linked services to the <ACE_Service_Repository>. + public: static void handle_signal (int sig, siginfo_t *, ucontext_t *); // Handles signals to trigger reconfigurations. diff --git a/ace/Service_Config.i b/ace/Service_Config.i index 309bce5f127..534b01fff80 100644 --- a/ace/Service_Config.i +++ b/ace/Service_Config.i @@ -30,6 +30,12 @@ ACE_Service_Config::signal_handler (ACE_Sig_Adapter *signal_handler) signal_handler_ = signal_handler; } +ACE_INLINE char +ACE_Service_Config::debug (void) +{ + return ACE_Service_Config::debug_; +} + #if defined (ACE_HAS_WINCE) // We must provide these function to bridge Svc_Conf parser with ACE. |