hpp-util 9.0.2
Debugging tools for the HPP project.
Loading...
Searching...
No Matches
hpp::debug::Channel Class Reference

Debugging output. More...

#include <hpp/util/debug.hh>

Public Types

typedef std::vector< Output * > subscribers_t

Public Member Functions

 Channel (char const *label, const subscribers_t &subscribers)
virtual ~Channel ()
void write (char const *file, int line, char const *function, const std::string &data)
void write (char const *file, int line, char const *function, const std::stringstream &data)
const char * label () const

Detailed Description

Debugging output.

Represents a debugging output, i.e. an output stream which can subscribe to channels.

There is two default output:

  • console which points to std::cerr
  • journal which points to the ``journal'' file in the debugging prefix */ class HPP_UTIL_DLLAPI Output { public: explicit Output(); virtual ~Output();

virtual void write(const Channel& channel, char const* file, int line, char const* function, const std::string& data) = 0;

virtual void write(const Channel& channel, char const* file, int line, char const* function, const std::stringstream& data) = 0;

protected: std::ostream& writePrefix(std::ostream& stream, const Channel& channel, char const* file, int line, char const* function); };

/** Receive debugging information.

Receive debugging information and forward it to its subscribers.

By default, there is four channels:

  • error for fatal problems
  • warning for non-fatal problems
  • notice for user information
  • info for technical information and debugging output

Member Typedef Documentation

◆ subscribers_t

typedef std::vector<Output*> hpp::debug::Channel::subscribers_t

Constructor & Destructor Documentation

◆ Channel()

hpp::debug::Channel::Channel ( char const * label,
const subscribers_t & subscribers )
explicit

◆ ~Channel()

hpp::debug::Channel::~Channel ( )
virtual

Member Function Documentation

◆ label()

const char * hpp::debug::Channel::label ( ) const

◆ write() [1/2]

void hpp::debug::Channel::write ( char const * file,
int line,
char const * function,
const std::string & data )

◆ write() [2/2]

void hpp::debug::Channel::write ( char const * file,
int line,
char const * function,
const std::stringstream & data )

The documentation for this class was generated from the following files: