diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-11-13 07:40:52 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-11-13 07:40:52 +0000 |
commit | fb348ab9bbc92f23d054f2bc4ffc6b1e34a07bf0 (patch) | |
tree | 18a2de9a9bad209202105e0e5182a547a0137427 | |
parent | 6d7509d42f9d2b3cc9bb180469b2c66344dcc1c9 (diff) | |
download | ATCD-fb348ab9bbc92f23d054f2bc4ffc6b1e34a07bf0.tar.gz |
ChangeLogTag:Thu Nov 13 00:39:17 2003 Nanbor Wang <nanbor@cse.wustl.edu>
-rw-r--r-- | TAO/CIAO/ChangeLog | 23 | ||||
-rw-r--r-- | TAO/CIAO/ciao/CIAO_common.h | 13 | ||||
-rw-r--r-- | TAO/CIAO/ciao/Client_init.cpp | 22 | ||||
-rw-r--r-- | TAO/CIAO/ciao/ServerActivator_Impl.cpp | 23 |
4 files changed, 65 insertions, 16 deletions
diff --git a/TAO/CIAO/ChangeLog b/TAO/CIAO/ChangeLog index 4cdcd3f87b6..750d00fa2c3 100644 --- a/TAO/CIAO/ChangeLog +++ b/TAO/CIAO/ChangeLog @@ -1,3 +1,12 @@ +Thu Nov 13 00:39:17 2003 Nanbor Wang <nanbor@cse.wustl.edu> + + * ciao/CIAO_common.h: + * ciao/Client_init.cpp: Added a CIAO::debug_level () function to + control the amount of debug info available. + + * ciao/ServerActivator_Impl.cpp: Used CIAO::debug_level() to + control emission of debug information. + Fri Oct 24 11:31:34 2003 Venkita Subramonian <venkita@cs.wustl.edu> * CIAO version 0.3.5 released. @@ -35,12 +44,12 @@ Thu Oct 16 16:45:35 2003 Boris Kolpackov <boris@dre.vanderbilt.edu> * CCF/CCF/IDL3/SyntaxTree/Operation.hpp: * CCF/Example/CIDL/LocalExecutorMapping/ExecutorMappingGenerator.cpp: Added support for struct. - + * CCF/Example/CIDL/LocalExecutorMapping/test-2.idl: * CCF/Example/CIDL/LocalExecutorMapping/test-2_exec.idl.orig: Added a few structs for testing. - * CCF/Documentation/TODO: Marked some items as done or + * CCF/Documentation/TODO: Marked some items as done or partially done. Thu Oct 16 12:55:06 2003 Boris Kolpackov <boris@dre.vanderbilt.edu> @@ -283,16 +292,16 @@ Sun Oct 12 20:44:41 2003 Jeff Parsons <j.parsons@vanderbilt.edu> * CIDLC/ServantHeaderGenerator.hpp: * CIDLC/ServantSourceGenerator.cpp: * CIDLC/ServantSourceGenerator.hpp: - Changed top of files to match the title/author/cvs id format for + Changed top of files to match the title/author/cvs id format for all other CCF and CIDLC files. * CIDLC/TypeNameEmitter.cpp: * CIDLC/TypeNameEmitter.hpp: - New files, adding support for all basic IDL types, and factoring - out the typename emitter classes for operation return types and - parameters into a separate translation unit, to eliminate the - duplication in ServantHeaderGenerator.cpp and + New files, adding support for all basic IDL types, and factoring + out the typename emitter classes for operation return types and + parameters into a separate translation unit, to eliminate the + duplication in ServantHeaderGenerator.cpp and ServantSourceGenerator.cpp. * CIDLC/cidlc.mpc: diff --git a/TAO/CIAO/ciao/CIAO_common.h b/TAO/CIAO/ciao/CIAO_common.h index 627bbbefacf..d5dbc78f584 100644 --- a/TAO/CIAO/ciao/CIAO_common.h +++ b/TAO/CIAO/ciao/CIAO_common.h @@ -18,6 +18,8 @@ #pragma once #endif /* ! ACE_LACKS_PRAGMA_ONCE */ +#include "CIAO_Client_Export.h" + #define CIAO_REGISTER_VALUE_FACTORY(ORB,FACTORY,VALUETYPE) {\ CORBA::ValueFactory factory = new FACTORY; \ CORBA::ValueFactory prev_factory = \ @@ -27,5 +29,16 @@ if (prev_factory) prev_factory->_remove_ref (); \ factory->_remove_ref (); } +namespace CIAO +{ + /// Return the debug level. The debug level of CIAO is control by + /// an environment variable "CIAO_DEBUG_LEVEL". It should be an int + /// value. If it is not defined, the default debug level is 0. The + /// value of debug value is evaluated on its first use and the value + /// is then cached. The actual implementation of this function is in + /// Client_init.cpp. + CIAO_CLIENT_Export int debug_level (void); +} + #include /**/ "ace/post.h" #endif /* CIAO_COMMON_H */ diff --git a/TAO/CIAO/ciao/Client_init.cpp b/TAO/CIAO/ciao/Client_init.cpp index b11d6b96dde..93d83982ee8 100644 --- a/TAO/CIAO/ciao/Client_init.cpp +++ b/TAO/CIAO/ciao/Client_init.cpp @@ -4,6 +4,7 @@ #include "CIAO_common.h" #include "CCM_ComponentC.h" #include "CIAO_ValueC.h" +#include "ace/Env_Value_T.h" int CIAO::Client_init (CORBA::ORB_ptr o) @@ -34,3 +35,24 @@ CIAO::Client_init (CORBA::ORB_ptr o) Components::ComponentPortDescription); return 0; } + +/// This should really be an anonymous namespace, but some compilers +/// still don't support this features. Therefore, just use a long +/// namespace name here. +namespace ciao_anonymous_namespace +{ + int debug_level = -1; +} + +int +CIAO::debug_level (void) +{ + if (ciao_anonymous_namespace::debug_level == -1) + { + // Initialize the thing. + ACE_Env_Value<int> envar ("CIAO_DEBUG_LEVEL", 0); + ciao_anonymous_namespace::debug_level = envar; + } + + return ciao_anonymous_namespace::debug_level; +} diff --git a/TAO/CIAO/ciao/ServerActivator_Impl.cpp b/TAO/CIAO/ciao/ServerActivator_Impl.cpp index b5e36235fad..73e52c28d24 100644 --- a/TAO/CIAO/ciao/ServerActivator_Impl.cpp +++ b/TAO/CIAO/ciao/ServerActivator_Impl.cpp @@ -3,6 +3,7 @@ #include "ServerActivator_Impl.h" #include "ace/Process.h" #include "ace/Read_Buffer.h" +#include "CIAO_common.h" #if !defined (__ACE_INLINE__) # include "ServerActivator_Impl.inl" @@ -163,15 +164,17 @@ CIAO::ServerActivator_Impl::init_svcconf_map (const char *filename) case 0: // All is fine. // Debug info: - ACE_DEBUG ((LM_DEBUG, - "Bound svc.conf hint \"%s\" successfully\n", - hint.c_str ())); + if (CIAO::debug_level () > 0) + ACE_DEBUG ((LM_DEBUG, + "Bound svc.conf hint \"%s\" successfully\n", + hint.c_str ())); break; case 1: - ACE_DEBUG ((LM_DEBUG, - "Duplication svc.conf hint \"%s\" found - ignore\n", - hint.c_str ())); + if (CIAO::debug_level () > 0) + ACE_DEBUG ((LM_DEBUG, + "Duplication svc.conf hint \"%s\" found - ignore\n", + hint.c_str ())); break; case -1: @@ -262,7 +265,8 @@ CIAO::ServerActivator_Impl::create_component_server (const Components::ConfigVal ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); - ACE_DEBUG ((LM_DEBUG, "CIAO::ServerActivator_Impl::create_component_server\n")); + if (CIAO::debug_level () > 0) + ACE_DEBUG ((LM_DEBUG, "CIAO::ServerActivator_Impl::create_component_server\n")); Components::Deployment::ComponentServer_var retval; @@ -314,8 +318,9 @@ CIAO::ServerActivator_Impl::create_component_server (const Components::ConfigVal if (svcconf_path != 0) { - ACE_DEBUG((LM_DEBUG, "Using svcconf file: %s\n", - svcconf_path)); + if (CIAO::debug_level () > 0) + ACE_DEBUG((LM_DEBUG, "Using svcconf file: %s\n", + svcconf_path)); additional_options += ACE_CString (" -ORBSvcConf "); additional_options += ACE_CString (svcconf_path); } |