'ODTONE - Open Dot Twenty One'

PrevUpHomeNext

Class logger

odtone::logger

Synopsis

// In header: </home/carlos/Projectos/odtone/inc/odtone/logger.hpp>


class logger {
public:
  // construct/copy/destruct
  logger(char const *const, logger &);
  logger(char const *const, std::ostream &);
  ~logger();

  // public member functions
  void level(uint);
  uint level() const;
  std::ostream & sink() const;
  template<typename T1> void operator()(uint, const T1 &);
  template<typename T1, typename T2> 
    void operator()(uint, const T1 &, const T2 &);
  template<typename T1, typename T2, typename T3> 
    void operator()(uint, const T1 &, const T2 &, const T3 &);
  template<typename T1, typename T2, typename T3, typename T4> 
    void operator()(uint, const T1 &, const T2 &, const T3 &, const T4 &);
  template<typename T1, typename T2, typename T3, typename T4, typename T5> 
    void operator()(uint, const T1 &, const T2 &, const T3 &, const T4 &, 
                    const T5 &);
  template<typename T1, typename T2, typename T3, typename T4, typename T5, 
           typename T6> 
    void operator()(uint, const T1 &, const T2 &, const T3 &, const T4 &, 
                    const T5 &, const T6 &);
  template<typename T1, typename T2, typename T3, typename T4, typename T5, 
           typename T6, typename T7> 
    void operator()(uint, const T1 &, const T2 &, const T3 &, const T4 &, 
                    const T5 &, const T6 &, const T7 &);
  template<typename T1, typename T2, typename T3, typename T4, typename T5, 
           typename T6, typename T7, typename T8> 
    void operator()(uint, const T1 &, const T2 &, const T3 &, const T4 &, 
                    const T5 &, const T6 &, const T7 &, const T8 &);
  template<typename T1, typename T2, typename T3, typename T4, typename T5, 
           typename T6, typename T7, typename T8, typename T9> 
    void operator()(uint, const T1 &, const T2 &, const T3 &, const T4 &, 
                    const T5 &, const T6 &, const T7 &, const T8 &, 
                    const T9 &);
  template<typename T1, typename T2, typename T3, typename T4, typename T5, 
           typename T6, typename T7, typename T8, typename T9, typename T10> 
    void operator()(uint, const T1 &, const T2 &, const T3 &, const T4 &, 
                    const T5 &, const T6 &, const T7 &, const T8 &, 
                    const T9 &, const T10 &);
};

Description

Mechanism for debugging, which provides logging procedures to log messages for a specific system or application component. Logger names can be arbitrary strings, but they should be based on the application that invoke it. Each logger has a level associated with it. This reflects the maximum level that the logger cares about. So, if the logger level is set to 2 it only cares about log messages belonging to level 0, 1 and 2. It also has an std::ostream object associated with it, which defines how the logger writes and formats the output. The log messages can have up to 10 arguments.

logger public construct/copy/destruct

  1. logger(char const *const name, logger & log);

    Construct a logger by copying it from another logger.

    Parameters:

    log

    Logger to copy.

    name

    Logger's name.

  2. logger(char const *const name, std::ostream & sink);

    Construct a logger.

    Parameters:

    name

    Logger's name.

    sink

    std::ostream which defines how the logger will write and format output.

  3. ~logger();

    Destruct a logger.

logger public member functions

  1. void level(uint n);

    Set the output level. Each logger has a level associated with it. This reflects the maximum level that the logger cares about. So, if the logger level is set to 2 it only cares about log messages belonging to level 0, 1 and 2.

    Parameters:

    n

    Logger level.

  2. uint level() const;

    Get the level configuration. Each logger has a level associated with it. This reflects the maximum level that the logger cares about. So, if the logger level is set to 2 it only cares about log messages belonging to level 0, 1 and 2.

    Returns:

    The logger level.

  3. std::ostream & sink() const;

    Get the std::ostream associated with the logger.

    Returns:

    The std::ostream associated with the logger.

  4. template<typename T1> void operator()(uint level, const T1 & arg1);

    XXX

  5. template<typename T1, typename T2> 
      void operator()(uint level, const T1 & arg1, const T2 & arg2);
  6. template<typename T1, typename T2, typename T3> 
      void operator()(uint level, const T1 & arg1, const T2 & arg2, 
                      const T3 & arg3);
  7. template<typename T1, typename T2, typename T3, typename T4> 
      void operator()(uint level, const T1 & arg1, const T2 & arg2, 
                      const T3 & arg3, const T4 & arg4);
  8. template<typename T1, typename T2, typename T3, typename T4, typename T5> 
      void operator()(uint level, const T1 & arg1, const T2 & arg2, 
                      const T3 & arg3, const T4 & arg4, const T5 & arg5);
  9. template<typename T1, typename T2, typename T3, typename T4, typename T5, 
             typename T6> 
      void operator()(uint level, const T1 & arg1, const T2 & arg2, 
                      const T3 & arg3, const T4 & arg4, const T5 & arg5, 
                      const T6 & arg6);
  10. template<typename T1, typename T2, typename T3, typename T4, typename T5, 
             typename T6, typename T7> 
      void operator()(uint level, const T1 & arg1, const T2 & arg2, 
                      const T3 & arg3, const T4 & arg4, const T5 & arg5, 
                      const T6 & arg6, const T7 & arg7);
  11. template<typename T1, typename T2, typename T3, typename T4, typename T5, 
             typename T6, typename T7, typename T8> 
      void operator()(uint level, const T1 & arg1, const T2 & arg2, 
                      const T3 & arg3, const T4 & arg4, const T5 & arg5, 
                      const T6 & arg6, const T7 & arg7, const T8 & arg8);
  12. template<typename T1, typename T2, typename T3, typename T4, typename T5, 
             typename T6, typename T7, typename T8, typename T9> 
      void operator()(uint level, const T1 & arg1, const T2 & arg2, 
                      const T3 & arg3, const T4 & arg4, const T5 & arg5, 
                      const T6 & arg6, const T7 & arg7, const T8 & arg8, 
                      const T9 & arg9);
  13. template<typename T1, typename T2, typename T3, typename T4, typename T5, 
             typename T6, typename T7, typename T8, typename T9, typename T10> 
      void operator()(uint level, const T1 & arg1, const T2 & arg2, 
                      const T3 & arg3, const T4 & arg4, const T5 & arg5, 
                      const T6 & arg6, const T7 & arg7, const T8 & arg8, 
                      const T9 & arg9, const T10 & arg10);

PrevUpHomeNext