diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2018-09-04 13:05:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-04 13:05:37 +0100 |
commit | 15ba1c53b779239d11e3451c196efff0855b17b7 (patch) | |
tree | 8163c588fbc72577945bc4f7027e336549938015 | |
parent | e1e2fd98b9bdf875ccca86fbe16c09ae54ffb948 (diff) | |
parent | d81e9fe526d94121a583d93ae73beff22bc34ee3 (diff) | |
download | ATCD-15ba1c53b779239d11e3451c196efff0855b17b7.tar.gz |
Merge pull request #692 from jwillemsen/jwi-imrlogging
Only log errors when we have a debugging level set
-rw-r--r-- | TAO/tao/ImR_Client/ImR_Client.cpp | 49 |
1 files changed, 30 insertions, 19 deletions
diff --git a/TAO/tao/ImR_Client/ImR_Client.cpp b/TAO/tao/ImR_Client/ImR_Client.cpp index 52951696fce..b98d874ccae 100644 --- a/TAO/tao/ImR_Client/ImR_Client.cpp +++ b/TAO/tao/ImR_Client/ImR_Client.cpp @@ -128,8 +128,7 @@ namespace } catch (const ::CORBA::Exception& ) { - return default_obj ( - "could not ImRify object with all profiles"); + return default_obj ("could not ImRify object with all profiles"); } } private: @@ -156,8 +155,7 @@ namespace CORBA::Object_ptr default_obj(const char* desc) { const CORBA::ULong pcount = base_profiles_.profile_count (); - const char* info = - "because couldn't find ImR profile_in_use in profiles"; + const char* info = "because couldn't find ImR profile_in_use in profiles"; // identify the profile in use to see if we can default to // that profiles partial ImR-ification @@ -172,19 +170,26 @@ namespace info = "because couldn't ImR-ify profile_in_use"; break; } - TAOLIB_ERROR((LM_ERROR, - ACE_TEXT("TAO_ImR_Client (%P|%t) - ERROR: %C. ") - ACE_TEXT("Defaulting to ImR-ifying profile_in_use\n"), - desc)); + + if (TAO_debug_level > 0) + { + TAOLIB_ERROR((LM_ERROR, + ACE_TEXT("TAO_ImR_Client (%P|%t) - ERROR: %C. ") + ACE_TEXT("Defaulting to ImR-ifying profile_in_use\n"), + desc)); + } return objs_[i]._retn (); } } - TAOLIB_ERROR((LM_ERROR, - ACE_TEXT ("TAO_ImR_Client (%P|%t) - ERROR: %C, ") - ACE_TEXT ("but cannot default to ImR-ifying profile_in_use %C\n"), - desc, - info)); + if (TAO_debug_level > 0) + { + TAOLIB_ERROR((LM_ERROR, + ACE_TEXT ("TAO_ImR_Client (%P|%t) - ERROR: %C, ") + ACE_TEXT ("but cannot default to ImR-ifying profile_in_use %C\n"), + desc, + info)); + } return CORBA::Object::_nil(); } @@ -215,9 +220,12 @@ namespace TAO if (CORBA::is_nil (imr.in ())) { - TAOLIB_ERROR ((LM_ERROR, - ACE_TEXT ("TAO_ImR_Client (%P|%t) - ERROR: No usable IMR initial reference ") - ACE_TEXT ("available but use IMR has been specified.\n"))); + if (TAO_debug_level > 0) + { + TAOLIB_ERROR ((LM_ERROR, + ACE_TEXT ("TAO_ImR_Client (%P|%t) - ERROR: No usable IMR initial reference ") + ACE_TEXT ("available but use IMR has been specified.\n"))); + } throw ::CORBA::TRANSIENT ( CORBA::SystemException::_tao_minor_code (TAO_IMPLREPO_MINOR_CODE, 0), CORBA::COMPLETED_NO); @@ -248,9 +256,12 @@ namespace TAO if (CORBA::is_nil (imr_locator.in ())) { - TAOLIB_ERROR ((LM_ERROR, - ACE_TEXT ("TAO_ImR_Client (%P|%t) - ERROR: Narrowed IMR initial reference ") - ACE_TEXT ("is nil but use IMR has been specified.\n"))); + if (TAO_debug_level > 0) + { + TAOLIB_ERROR ((LM_ERROR, + ACE_TEXT ("TAO_ImR_Client (%P|%t) - ERROR: Narrowed IMR initial reference ") + ACE_TEXT ("is nil but use IMR has been specified.\n"))); + } throw ::CORBA::TRANSIENT ( CORBA::SystemException::_tao_minor_code (TAO_IMPLREPO_MINOR_CODE, 0), |