hpp-util 6.0.0
Debugging tools for the HPP project.
Loading...
Searching...
No Matches
hpp::debug Namespace Reference

Namespaces

namespace  verbosityLevel
 

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.
 
HPP_UTIL_DLLAPI std::string getFilename (const std::string &filename, const std::string &packageName)
 Compute the path of a file in the logging prefix.
 
HPP_UTIL_DLLAPI int getVerbosityLevel ()
 Get the verbosity level.
 
HPP_UTIL_DLLAPI void setVerbosityLevel (int level)
 Set the verbosity level.
 
HPP_UTIL_DLLAPI bool isBenchmarkEnabled ()
 
HPP_UTIL_DLLAPI void enableBenchmark (bool enable)
 
bool isChannelEnabled (int channel)
 
std::ostream & operator<< (std::ostream &os, const TimeCounter &tc)
 

Variables

HPP_UTIL_DLLAPI Logging logging
 Benchmark information.
 
HPP_UTIL_DLLAPI SetVerbosityLevelFromEnvVar setVerbosityLevelFromEnvVar
 

Function Documentation

◆ enableBenchmark()

void hpp::debug::enableBenchmark ( bool  enable)

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

◆ getVerbosityLevel()

int hpp::debug::getVerbosityLevel ( )

Get the verbosity level.

◆ isBenchmarkEnabled()

bool hpp::debug::isBenchmarkEnabled ( )

◆ isChannelEnabled()

bool hpp::debug::isChannelEnabled ( int  channel)
inline

◆ operator<<()

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

◆ setVerbosityLevel()

void hpp::debug::setVerbosityLevel ( int  level)

Set the verbosity level.

Variable Documentation

◆ logging

HPP_UTIL_DLLAPI Logging hpp::debug::logging

Benchmark information.

◆ setVerbosityLevelFromEnvVar

HPP_UTIL_DLLAPI SetVerbosityLevelFromEnvVar hpp::debug::setVerbosityLevelFromEnvVar