hpp-util  4.9.0
Debugging tools for the HPP project.
hpp::debug Namespace Reference

Classes

class  Channel
 Receive debugging information. More...
 
class  ConsoleOutput
 Logging in console (std::cerr). More...
 
class  JournalOutput
 Logging in journal file in the logging directory. More...
 
class  Logging
 Logging class owns all channels and outputs. More...
 
class  Output
 Debugging output. More...
 
class  TimeCounter
 Computation of min, max and mean time from a set of measurements. More...
 
class  Timer
 

Functions

HPP_UTIL_DLLAPI std::string getPrefix (const std::string &packageName)
 Compute the logging prefix. More...
 
HPP_UTIL_DLLAPI std::string getFilename (const std::string &filename, const std::string &packageName)
 Compute the path of a file in the logging prefix. More...
 
std::ostream & operator<< (std::ostream &os, const TimeCounter &tc)
 

Variables

HPP_UTIL_DLLAPI Logging logging
 Benchmark information. More...
 

Function Documentation

◆ getFilename()

std::string hpp::debug::getFilename ( const std::string &  filename,
const std::string &  packageName 
)

Compute the path of a file in the logging prefix.

Apply the same rules than getPrefix and append the filename to build the whole path.

Parameters
filenameName of the file (will be appended to the prefix)
packageNamename of the package, must be a valid Unix filename (the use of PACKAGE_TARNAME is strongly encouraged).

◆ getPrefix()

std::string hpp::debug::getPrefix ( const std::string &  packageName)

Compute the logging prefix.

This method returns the logging prefix. It means the directory where all debugging output must be stored.

The prefix is $localstatedir/log/$packagename.

  • localstatedir: [prefix]/var (by default /usr/local/var)
  • packagename: this function's first argument

To use this function, first include config.h and use the PACKAGE_TARNAME provided by Autoheader as this function's first argument.

The prefix $localstatedir/log can be overrided by the environment variable HPP_LOGGINGDIR.

Parameters
packageNamename of the package, must be a valid Unix filename (the use of PACKAGE_TARNAME is strongly encouraged).

◆ operator<<()

std::ostream & hpp::debug::operator<< ( std::ostream &  os,
const TimeCounter tc 
)

Variable Documentation

◆ logging

HPP_UTIL_DLLAPI Logging hpp::debug::logging

Benchmark information.