From fad66c89daa4de965d2969f5c59b4a63b6971148 Mon Sep 17 00:00:00 2001 From: Christian Engwer <christi@dune-project.org> Date: Fri, 4 Aug 2006 11:11:58 +0000 Subject: [PATCH] set MINIMAL_DEBUG_LEVEL via configure parameter [[Imported from SVN: r4676]] --- common/stdstreams.cc | 2 +- common/stdstreams.hh | 6 +++++- m4/dune_all.m4 | 1 + m4/dune_streams.m4 | 44 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 m4/dune_streams.m4 diff --git a/common/stdstreams.cc b/common/stdstreams.cc index 81c6e2c5a..eb0638f39 100644 --- a/common/stdstreams.cc +++ b/common/stdstreams.cc @@ -2,7 +2,7 @@ // vi: set et ts=4 sw=2 sts=2: // $Id$ - +#include <config.h> #include "stdstreams.hh" namespace Dune { diff --git a/common/stdstreams.hh b/common/stdstreams.hh index bc228e87f..458d9a3dc 100644 --- a/common/stdstreams.hh +++ b/common/stdstreams.hh @@ -22,6 +22,10 @@ namespace Dune { standard debug streams with level below MINIMAL_DEBUG_LEVEL will collapse to doing nothing if output is requested. + MINIMAL_DEBUG_LEVEL is set to DUNE_MINIMAL_DEBUG_LEVEL, wich is + defined in config.h and can be changed by the configure option + @code --with-minimal-debug-level=[grave|warn|info|verb|vverb] @endcode + For a Dune-Release this should be set to at least 4 so that only important messages are active. Dune-developers may adapt this setting to their debugging needs locally @@ -61,7 +65,7 @@ namespace Dune { * If the level of a stream is bigger than this value * it will be activated. */ - static const DebugLevel MINIMAL_DEBUG_LEVEL = 4; + static const DebugLevel MINIMAL_DEBUG_LEVEL = DUNE_MINIMAL_DEBUG_LEVEL; /** * @brief The level of the very verbose debug stream. diff --git a/m4/dune_all.m4 b/m4/dune_all.m4 index 448220a80..fd97f80fc 100644 --- a/m4/dune_all.m4 +++ b/m4/dune_all.m4 @@ -94,6 +94,7 @@ AC_SUBST(DUNEWEBDIR, $with_duneweb) dnl check all components DUNE_MODULE_DEPENDENCIES($@) + AC_REQUIRE([DUNE_SET_MINIMAL_DEBUG_LEVEL]) AC_REQUIRE([DUNE_PATH_XDR]) AC_REQUIRE([DUNE_GRID_DIMENSION]) AC_REQUIRE([DUNE_PATH_GRAPE]) diff --git a/m4/dune_streams.m4 b/m4/dune_streams.m4 new file mode 100644 index 000000000..7ef6240b9 --- /dev/null +++ b/m4/dune_streams.m4 @@ -0,0 +1,44 @@ +# $Id: dune_deprecated.m4 1114 2004-11-17 14:00:06Z christi $ + +# Set the minimal verbosity level. All stream with a level below will +# get removed by the optimizer. + +AC_DEFUN([DUNE_SET_MINIMAL_DEBUG_LEVEL],[ + + # VERY_VERBOSE_DEBUG_LEVEL = 1; + # VERBOSE_DEBUG_LEVEL = 2; + # INFO_DEBUG_LEVEL = 3; + # WARN_DEBUG_LEVEL = 4; + # GRAVE_DEBUG_LEVEL = 5; + + AC_ARG_WITH(minimal-debug-level, + AC_HELP_STRING([--with-minimal-debug-level=[grave|warn|info|verb|vverb]], + [set the MINIMAL_DEBUG_LEVEL. Standard debug streams with level below + MINIMAL_DEBUG_LEVEL will collapse to doing nothing if output is + requested. (default=warn)] + ) + ) + + MINIMAL_DEBUG_LEVEL=4 + + case "$with_psurface" in + grave) + MINIMAL_DEBUG_LEVEL=5 + ;; + warn) + MINIMAL_DEBUG_LEVEL=4 + ;; + info) + MINIMAL_DEBUG_LEVEL=3 + ;; + verb) + MINIMAL_DEBUG_LEVEL=2 + ;; + vverb) + MINIMAL_DEBUG_LEVEL=1 + ;; + esac + + AC_DEFINE_UNQUOTED([DUNE_MINIMAL_DEBUG_LEVEL], $MINIMAL_DEBUG_LEVEL, + [Standard debug streams with a level below will collapse to doing nothing]) +]) -- GitLab