Skip to content
Snippets Groups Projects
stdstreams.hh 4.68 KiB
Newer Older
  • Learn to ignore specific revisions
  • // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    // vi: set et ts=4 sw=2 sts=2:
    // $Id$
    
    
    Christian Engwer's avatar
    Christian Engwer committed
    /**
       \file
       \brief Standard Dune debug streams
    
    Christian Engwer's avatar
    Christian Engwer committed
       The standard debug streams are compiled into libdune to exist
       globally. This file declares the stream types and the global debug
       level.
    
    #ifndef DUNE_COMMON_STDSTREAMS_HH
    #define DUNE_COMMON_STDSTREAMS_HH
    
    
    #include "debugstream.hh"
    
    namespace Dune {
    
    
    Christian Engwer's avatar
    Christian Engwer committed
      /**
          \addtogroup DebugOut
          @{
    
    Christian Engwer's avatar
    Christian Engwer committed
          standard debug streams with level below MINIMAL_DEBUG_LEVEL will
          collapse to doing nothing if output is requested.
    
    Christian Engwer's avatar
    Christian Engwer committed
          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
    
    Markus Blatt's avatar
    Markus Blatt committed
    
    
    Christian Engwer's avatar
    Christian Engwer committed
          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
    
    Markus Blatt's avatar
    Markus Blatt committed
    
    
    Christian Engwer's avatar
    Christian Engwer committed
          Keep in mind that libdune has to be recompiled if this value is changed!
    
    Christian Engwer's avatar
    Christian Engwer committed
          The singleton instances of the available debug streams can be found in
          the \ref DebugOut "Standard Debug Streams" module
    
    Markus Blatt's avatar
    Markus Blatt committed
    
    
    Christian Engwer's avatar
    Christian Engwer committed
          @}
    
    Markus Blatt's avatar
    Markus Blatt committed
       */
    
    Christian Engwer's avatar
    Christian Engwer committed
    
      /**
    
    Markus Blatt's avatar
    Markus Blatt committed
         \defgroup StdStreams Standard Debug Streams
         \ingroup DebugOut
         @{
    
         Dune defines several standard output streams for the library
         routines.
    
         Applications may control the standard streams via the attach/detach,
         push/pop interface but should define an independent set of streams (see \ref DebugAppl )
    
       */
    
      /**
    
    Christian Engwer's avatar
    Christian Engwer committed
          @brief The default minimum debug level.
    
          If the  level of a stream is bigger than this value
          it will be activated.
    
    Christian Engwer's avatar
    Christian Engwer committed
    #ifndef DUNE_MINIMAL_DEBUG_LEVEL
    #define DUNE_MINIMAL_DEBUG_LEVEL 4
    #endif
    
      static const DebugLevel MINIMAL_DEBUG_LEVEL = DUNE_MINIMAL_DEBUG_LEVEL;
    
    Christian Engwer's avatar
    Christian Engwer committed
          @brief The level of the very verbose debug stream.
          @see dvverb
    
       */
      static const DebugLevel VERY_VERBOSE_DEBUG_LEVEL = 1;
    
      /**
          @brief Type of very verbose debug stream.
          @see dvverb
       */
      typedef DebugStream<VERY_VERBOSE_DEBUG_LEVEL, MINIMAL_DEBUG_LEVEL> DVVerbType;
    
    Markus Blatt's avatar
    Markus Blatt committed
    
    
    Christian Engwer's avatar
    Christian Engwer committed
      /**
          \brief stream for very verbose output.
    
    Markus Blatt's avatar
    Markus Blatt committed
    
    
    Christian Engwer's avatar
    Christian Engwer committed
          \code
    
    Christian Engwer's avatar
    Christian Engwer committed
          \endcode
    
    Christian Engwer's avatar
    Christian Engwer committed
          Information on the lowest
          level. This is expected to report insane amounts of
          information. Use of the activation-flag to only generate output
          near the problem is recommended.
    
    Markus Blatt's avatar
    Markus Blatt committed
       */
    
    Christian Engwer's avatar
    Christian Engwer committed
          @brief The level of the verbose debug stream.
          @see dvverb
    
       */
      static const DebugLevel VERBOSE_DEBUG_LEVEL = 2;
    
      /**
          @brief Type of more verbose debug stream.
          @see dverb
       */
      typedef DebugStream<VERBOSE_DEBUG_LEVEL, MINIMAL_DEBUG_LEVEL> DVerbType;
    
    
    Christian Engwer's avatar
    Christian Engwer committed
         @brief Singleton of verbose debug stream.
    
         \code
         #include <dune/common/stdstreams.hh>
         \endcode
    
    Christian Engwer's avatar
    Christian Engwer committed
          @brief The level of the informative debug stream.
          @see dinfo
    
       */
      static const DebugLevel INFO_DEBUG_LEVEL = 3;
    
      /**
          @brief Type of debug stream with info level.
          @see dinfo
       */
      typedef DebugStream<INFO_DEBUG_LEVEL, MINIMAL_DEBUG_LEVEL> DInfoType;
    
    Markus Blatt's avatar
    Markus Blatt committed
    
      /**
          @brief Stream for informative output.
    
    
          \code
         #include <dune/common/stdstreams.hh>
          \endcode
    
    
    Markus Blatt's avatar
    Markus Blatt committed
          Summary infos on what a module
          does, runtimes, etc.
       */
    
    Christian Engwer's avatar
    Christian Engwer committed
          @brief The level of the debug stream for warnings.
          @see dwarn
    
       */
      static const DebugLevel WARN_DEBUG_LEVEL = 4;
    
      /**
          @brief Type of debug stream with warn level.
          @see dwarn
       */
      typedef DebugStream<WARN_DEBUG_LEVEL, MINIMAL_DEBUG_LEVEL> DWarnType;
    
    Markus Blatt's avatar
    Markus Blatt committed
    
    
    Christian Engwer's avatar
    Christian Engwer committed
         @brief Stream for warnings indicating problems.
    
         \code
         #include <dune/common/stdstreams.hh>
         \endcode
    
    Christian Engwer's avatar
    Christian Engwer committed
          @brief The level of the debug stream for fatal errors.
          @see dgrave
    
       */
      static const DebugLevel GRAVE_DEBUG_LEVEL = 5;
    
    
    Markus Blatt's avatar
    Markus Blatt committed
      /** @brief Type of debug stream for fatal errors.*/
    
      typedef DebugStream<GRAVE_DEBUG_LEVEL, MINIMAL_DEBUG_LEVEL> DGraveType;
    
    Markus Blatt's avatar
    Markus Blatt committed
    
    
    Christian Engwer's avatar
    Christian Engwer committed
         @brief Stream for warnings indicating fatal errors.
    
         \code
         #include <dune/common/stdstreams.hh>
         \endcode
    
      /** @brief The type of the stream used for error messages. */
    
      typedef DebugStream<1> DErrType;
    
    Markus Blatt's avatar
    Markus Blatt committed
    
    
    Christian Engwer's avatar
    Christian Engwer committed
      /**
    
    Markus Blatt's avatar
    Markus Blatt committed
         @brief Stream for error messages.
    
    
         \code
         #include <dune/common/stdstreams.hh>
         \endcode
    
    
    Markus Blatt's avatar
    Markus Blatt committed
         Only packages integrating Dune
    
    Oliver Sander's avatar
    Oliver Sander committed
         completely will redirect it. The output of derr is independent of
    
    Markus Blatt's avatar
    Markus Blatt committed
         the debug-level, only the activation-flag is checked.
       */
    
    Thimo Neubauer's avatar
    Thimo Neubauer committed
    
    
    Christian Engwer's avatar
    Christian Engwer committed
      /** }@ */