ViennaSHE 1.3.0
Free open-source semiconductor device simulator using spherical harmonics expansions techniques.
viennashe::log::logger< enabled > Class Template Reference

The Main logger class. Assembles output lines and writes them to std::cout upon destruction. More...

#include <log.hpp>

Public Types

typedef std::ostream &(* ostream_manipulator) (std::ostream &)
 

Public Member Functions

 logger ()
 
 logger (log_levels level)
 
 logger (const std::string &component_name)
 CTOR to log componentwise. Adds [component_name] to the start of every log-line. More...
 
 logger (log_levels level, const std::string &component_name)
 CTOR to log componentwise on a certain log-level. Adds [component_name] to the start of every log-line. More...
 
 logger (const logger &r)
 
 ~logger ()
 Destructor. Does actually write the log-message to the output-stream (normally std::cout) More...
 
bool do_log () const
 Returns true if the log-level is smaller than the globally set one. More...
 
CollectorStreamType & get ()
 Returns the collector stream to collect the output. More...
 
CollectorStreamType const & get () const
 Returns the collector stream to collect the output. More...
 
template<typename T >
CollectorStreamType & operator<< (const T &x)
 Generic shift left operator to print stuff via the logger. More...
 
CollectorStreamType & operator<< (ostream_manipulator pf)
 
CollectorStreamType & operator<< (std::string &x)
 
CollectorStreamType & operator<< (const std::string &x)
 
CollectorStreamType & operator<< (const char *x)
 
CollectorStreamType & operator<< (logger &r)
 

Detailed Description

template<bool enabled>
class viennashe::log::logger< enabled >

The Main logger class. Assembles output lines and writes them to std::cout upon destruction.

Template Parameters
enabledIf false the logger class does the same as the nullstream ... nothing

Definition at line 75 of file log.hpp.

Member Typedef Documentation

◆ ostream_manipulator

template<bool enabled>
typedef std::ostream &(* viennashe::log::logger< enabled >::ostream_manipulator) (std::ostream &)

Definition at line 178 of file log.hpp.

Constructor & Destructor Documentation

◆ logger() [1/5]

template<bool enabled>
viennashe::log::logger< enabled >::logger ( )
inlineexplicit

Definition at line 87 of file log.hpp.

◆ logger() [2/5]

template<bool enabled>
viennashe::log::logger< enabled >::logger ( log_levels  level)
inline

Definition at line 89 of file log.hpp.

◆ logger() [3/5]

template<bool enabled>
viennashe::log::logger< enabled >::logger ( const std::string &  component_name)
inline

CTOR to log componentwise. Adds [component_name] to the start of every log-line.

Definition at line 92 of file log.hpp.

◆ logger() [4/5]

template<bool enabled>
viennashe::log::logger< enabled >::logger ( log_levels  level,
const std::string &  component_name 
)
inline

CTOR to log componentwise on a certain log-level. Adds [component_name] to the start of every log-line.

Definition at line 98 of file log.hpp.

◆ logger() [5/5]

template<bool enabled>
viennashe::log::logger< enabled >::logger ( const logger< enabled > &  r)
inline

Definition at line 103 of file log.hpp.

◆ ~logger()

template<bool enabled>
viennashe::log::logger< enabled >::~logger ( )
inline

Destructor. Does actually write the log-message to the output-stream (normally std::cout)

Definition at line 109 of file log.hpp.

Member Function Documentation

◆ do_log()

template<bool enabled>
bool viennashe::log::logger< enabled >::do_log ( ) const
inline

Returns true if the log-level is smaller than the globally set one.

Definition at line 163 of file log.hpp.

◆ get() [1/2]

template<bool enabled>
CollectorStreamType & viennashe::log::logger< enabled >::get ( )
inline

Returns the collector stream to collect the output.

Definition at line 166 of file log.hpp.

◆ get() [2/2]

template<bool enabled>
CollectorStreamType const & viennashe::log::logger< enabled >::get ( ) const
inline

Returns the collector stream to collect the output.

Definition at line 168 of file log.hpp.

◆ operator<<() [1/6]

template<bool enabled>
CollectorStreamType & viennashe::log::logger< enabled >::operator<< ( const char *  x)
inline

Definition at line 197 of file log.hpp.

◆ operator<<() [2/6]

template<bool enabled>
CollectorStreamType & viennashe::log::logger< enabled >::operator<< ( const std::string &  x)
inline

Definition at line 191 of file log.hpp.

◆ operator<<() [3/6]

template<bool enabled>
template<typename T >
CollectorStreamType & viennashe::log::logger< enabled >::operator<< ( const T &  x)
inline

Generic shift left operator to print stuff via the logger.

Definition at line 172 of file log.hpp.

◆ operator<<() [4/6]

template<bool enabled>
CollectorStreamType & viennashe::log::logger< enabled >::operator<< ( logger< enabled > &  r)
inline

Definition at line 203 of file log.hpp.

◆ operator<<() [5/6]

template<bool enabled>
CollectorStreamType & viennashe::log::logger< enabled >::operator<< ( ostream_manipulator  pf)
inline

Definition at line 179 of file log.hpp.

◆ operator<<() [6/6]

template<bool enabled>
CollectorStreamType & viennashe::log::logger< enabled >::operator<< ( std::string &  x)
inline

Definition at line 185 of file log.hpp.


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