ViennaSHE 1.3.0
Free open-source semiconductor device simulator using spherical harmonics expansions techniques.
viennashe::log Namespace Reference

Namespace holding the logging facility. More...

Namespaces

namespace  detail
 Namespace for implementation details within the viennashe::log namespace. Typically not of interest for the library user.
 

Classes

class  logger
 The Main logger class. Assembles output lines and writes them to std::cout upon destruction. More...
 
class  logger< false >
 Template specialization of the logger for the case enabled=false ... does nothing. Ensures that no runtime penalty is present if the logger is disabled via the template parameter. More...
 
struct  nullstream
 Streaming class which only provides operator<< discarding the right hand side. More...
 

Enumerations

enum  log_levels {
  logERROR = 0 , logWARNING , logINFO , logDEBUG ,
  logNEVER
}
 Defines various log-levels. Note that log levels are inclusive, i.e. log levels with larger number include log levels with smaller number. More...
 

Functions

void set_log_level (log_levels new_level)
 Sets the global log level. More...
 
log_levels log_level ()
 Getter for the global log level. More...
 
logger< true > error ()
 Used to log errors. The logging level is logERROR. More...
 
logger< true > warn ()
 Used to log warnings. The logging level is logWARNING. More...
 
logger< true > warning ()
 Used to log warnings. The logging level is logWARNING. More...
 
logger< true > info ()
 Used to log infos. The logging level is logINFO. More...
 
logger< true > debug ()
 Used to log debug output. The logging level is logDEBUG. More...
 
template<typename KeyTypeT >
logger< KeyTypeT::enabled > error ()
 Used to log errors for a certain component. If KeyTypeT::enabled is false no output will be generated. The logging level is logERROR. More...
 
template<typename KeyTypeT >
logger< KeyTypeT::enabled > warn ()
 Used to log warnings for a certain component. If KeyTypeT::enabled is false no output will be generated. The logging level is logWARNING. More...
 
template<typename KeyTypeT >
logger< KeyTypeT::enabled > warning ()
 Used to log warnings for a certain component. If KeyTypeT::enabled is false no output will be generated. The logging level is logWARNING. More...
 
template<typename KeyTypeT >
logger< KeyTypeT::enabled > info ()
 Used to log infos for a certain component. If KeyTypeT::enabled is false no output will be generated. The logging level is logINFO. More...
 
template<typename KeyTypeT >
logger< KeyTypeT::enabled > debug ()
 Used to log debug output for a certain component. If KeyTypeT::enabled is false no output will be generated. The logging level is logDEBUG. More...
 
nullstreamget_nullstream ()
 Singleton factory for nullstream. More...
 
template<typename T >
nullstreamoperator<< (nullstream &s, T const &)
 Generic shift left operator. Throws anything it gets away. More...
 
nullstreamoperator<< (nullstream &s, const std::string &)
 Specialization of the generic template function. Returns same as get_nullstream(). Does nothing. More...
 
nullstreamoperator<< (nullstream &s, const char *)
 Specialization of the generic template function. Returns same as get_nullstream(). Does nothing. More...
 
nullstreamoperator<< (nullstream &s, std::ostream &(std::ostream &))
 Specialization of the generic template function for std::endl. Returns same as get_nullstream(). Does nothing. More...
 

Detailed Description

Namespace holding the logging facility.

Enumeration Type Documentation

◆ log_levels

Defines various log-levels. Note that log levels are inclusive, i.e. log levels with larger number include log levels with smaller number.

Enumerator
logERROR 
logWARNING 

logger outputs errors only

logINFO 

logger outputs errors and warnings

logDEBUG 

logger outputs errors, warnings and status information

logNEVER 

logger outputs lots of debug infos as well

Nothing is logged. Internal note: must be the last in the list!

Definition at line 44 of file log.hpp.

Function Documentation

◆ debug() [1/2]

logger< true > viennashe::log::debug ( )
inline

Used to log debug output. The logging level is logDEBUG.

Definition at line 309 of file log.hpp.

◆ debug() [2/2]

template<typename KeyTypeT >
logger< KeyTypeT::enabled > viennashe::log::debug ( )

Used to log debug output for a certain component. If KeyTypeT::enabled is false no output will be generated. The logging level is logDEBUG.

Definition at line 336 of file log.hpp.

◆ error() [1/2]

logger< true > viennashe::log::error ( )
inline

Used to log errors. The logging level is logERROR.

Definition at line 301 of file log.hpp.

◆ error() [2/2]

template<typename KeyTypeT >
logger< KeyTypeT::enabled > viennashe::log::error ( )

Used to log errors for a certain component. If KeyTypeT::enabled is false no output will be generated. The logging level is logERROR.

Definition at line 316 of file log.hpp.

◆ get_nullstream()

nullstream & viennashe::log::get_nullstream ( )
inline

Singleton factory for nullstream.

Returns
Returns a non-const reference to the nullstream

Definition at line 37 of file nullstream.hpp.

◆ info() [1/2]

logger< true > viennashe::log::info ( )
inline

Used to log infos. The logging level is logINFO.

Definition at line 307 of file log.hpp.

◆ info() [2/2]

template<typename KeyTypeT >
logger< KeyTypeT::enabled > viennashe::log::info ( )

Used to log infos for a certain component. If KeyTypeT::enabled is false no output will be generated. The logging level is logINFO.

Definition at line 331 of file log.hpp.

◆ log_level()

log_levels viennashe::log::log_level ( )
inline

Getter for the global log level.

Definition at line 68 of file log.hpp.

◆ operator<<() [1/4]

nullstream & viennashe::log::operator<< ( nullstream s,
const char *   
)
inline

Specialization of the generic template function. Returns same as get_nullstream(). Does nothing.

Definition at line 55 of file nullstream.hpp.

◆ operator<<() [2/4]

nullstream & viennashe::log::operator<< ( nullstream s,
const std::string &   
)
inline

Specialization of the generic template function. Returns same as get_nullstream(). Does nothing.

Definition at line 53 of file nullstream.hpp.

◆ operator<<() [3/4]

nullstream & viennashe::log::operator<< ( nullstream s,
std::ostream &  std::ostream & 
)
inline

Specialization of the generic template function for std::endl. Returns same as get_nullstream(). Does nothing.

Definition at line 58 of file nullstream.hpp.

◆ operator<<() [4/4]

template<typename T >
nullstream & viennashe::log::operator<< ( nullstream s,
T const &   
)

Generic shift left operator. Throws anything it gets away.

Returns
The same object as get_nullstream()

Definition at line 50 of file nullstream.hpp.

◆ set_log_level()

void viennashe::log::set_log_level ( log_levels  new_level)
inline

Sets the global log level.

Definition at line 66 of file log.hpp.

◆ warn() [1/2]

logger< true > viennashe::log::warn ( )
inline

Used to log warnings. The logging level is logWARNING.

Definition at line 303 of file log.hpp.

◆ warn() [2/2]

template<typename KeyTypeT >
logger< KeyTypeT::enabled > viennashe::log::warn ( )

Used to log warnings for a certain component. If KeyTypeT::enabled is false no output will be generated. The logging level is logWARNING.

Definition at line 321 of file log.hpp.

◆ warning() [1/2]

logger< true > viennashe::log::warning ( )
inline

Used to log warnings. The logging level is logWARNING.

Definition at line 305 of file log.hpp.

◆ warning() [2/2]

template<typename KeyTypeT >
logger< KeyTypeT::enabled > viennashe::log::warning ( )

Used to log warnings for a certain component. If KeyTypeT::enabled is false no output will be generated. The logging level is logWARNING.

Definition at line 326 of file log.hpp.