diff options
author | schnetter <schnetter@83718e91-0e4f-0410-abf4-91180603181f> | 2005-10-15 22:03:53 +0000 |
---|---|---|
committer | schnetter <schnetter@83718e91-0e4f-0410-abf4-91180603181f> | 2005-10-15 22:03:53 +0000 |
commit | 0b1e40744a1449efe3daaae419aa1915f30a1403 (patch) | |
tree | 229456b248a38c583b9966371101bec4890d71d7 /src/announce.cc | |
parent | 8cb62833f75fba8a2b9fd75827852ca301ab1cf5 (diff) |
Register the functions that intercept the warnings and info message
only when the user actually wants to announce them.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/Formaline/trunk@65 83718e91-0e4f-0410-abf4-91180603181f
Diffstat (limited to 'src/announce.cc')
-rw-r--r-- | src/announce.cc | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/src/announce.cc b/src/announce.cc index f914263..e7ca287 100644 --- a/src/announce.cc +++ b/src/announce.cc @@ -901,13 +901,19 @@ namespace Formaline DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; - int const ierr1 - = CCTK_WarnCallbackRegister (0, max_warn_level, cctkGH, CatchWarning); - assert (! ierr1); + if (max_warn_level >= 0) + { + int const ierr1 + = CCTK_WarnCallbackRegister (0, max_warn_level, cctkGH, CatchWarning); + assert (! ierr1); + } - int const ierr2 - = CCTK_InfoCallbackRegister (cctkGH, CatchInfo); - assert (! ierr2); + if (output_info) + { + int const ierr2 + = CCTK_InfoCallbackRegister (cctkGH, CatchInfo); + assert (! ierr2); + } } #else @@ -918,13 +924,19 @@ namespace Formaline { DECLARE_CCTK_PARAMETERS; - int const ierr1 - = CCTK_WarnCallbackRegister (0, max_warn_level, 0, CatchWarning); - assert (! ierr1); + if (max_warn_level >= 0) + { + int const ierr1 + = CCTK_WarnCallbackRegister (0, max_warn_level, 0, CatchWarning); + assert (! ierr1); + } - int const ierr2 - = CCTK_InfoCallbackRegister (0, CatchInfo); - assert (! ierr2); + if (output_info) + { + int const ierr2 + = CCTK_InfoCallbackRegister (0, CatchInfo); + assert (! ierr2); + } return 0; } |