hpp::debug Namespace Reference

Classes

class  Output
 Debugging output. More...
class  Channel
 Receive debugging information. More...
class  JournalOutput
 Logging in journal file in the logging directory. More...
class  ConsoleOutput
 Logging in console (std::cerr). More...
class  Logging
 Logging class owns all channels and outputs. More...
class  Timer
class  TimeCounter

Functions

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

Variables

HPP_UTIL_DLLAPI Logging logging
 Benchmark information.
static const char * ENV_LOGGINGDIR = "HPP_LOGGINGDIR"
 Environment variable used to change the logging directory.

Function Documentation

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).

References 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).

References ENV_LOGGINGDIR.

Referenced by getFilename().

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

Variable Documentation

const char* hpp::debug::ENV_LOGGINGDIR = "HPP_LOGGINGDIR" [static]

Environment variable used to change the logging directory.

Referenced by getPrefix().

HPP_UTIL_DLLAPI Logging hpp::debug::logging

Benchmark information.