JeVois  1.5
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
jevois::Log< Level > Class Template Reference

#include <jevois/Debug/Log.H>

template<int Level>
class jevois::Log< Level >

Logger class.

Users would typically not use this class directly but instead invoke one of the LDEBUG(msg), LINFO(msg), etc macros. Note that by default logging is asynchronous, i.e., when issuing a log message it is assembled and then pushed into a queue, and another thread then pops it back from the queue and displays it. Define JEVOIS_USE_SYNC_LOG at compile time to have the mesage displayed immediately but beware that this can break USB strict timing requirements.

Definition at line 55 of file Log.H.

Public Member Functions

 Log (char const *fullFileName, char const *functionName, std::string *outstr=nullptr)
 Construct a new Log, adding a prefix to the log stream. More...
 
 ~Log ()
 Close the Log, outputting the aggregated message. More...
 
template<class T >
Log< Level > & operator<< (T const &out_item)
 Overloaded stream input operator for any type that has operator<< defined for ostream. More...
 
Log< Level > & operator<< (uint8_t const &out_item)
 Overload of operator<< for uint8 (displays it as an int rather than char) More...
 
Log< Level > & operator<< (int8_t const &out_item)
 Overload of operator<< for int8 (displays it as an int rather than char) More...
 

Constructor & Destructor Documentation

◆ Log()

template<int Level>
jevois::Log< Level >::Log ( char const *  fullFileName,
char const *  functionName,
std::string *  outstr = nullptr 
)

Construct a new Log, adding a prefix to the log stream.

If outstr is non-null, the log message will be copied into it upon destruction.

Definition at line 120 of file Log.C.

References jevois::Log< Level >::~Log().

◆ ~Log()

template<int Level>
jevois::Log< Level >::~Log ( )

Close the Log, outputting the aggregated message.

Definition at line 148 of file Log.C.

Referenced by jevois::Log< Level >::Log().

Member Function Documentation

◆ operator<<() [1/3]

template<int Level>
template<class T >
Log<Level>& jevois::Log< Level >::operator<< ( T const &  out_item)
inline

Overloaded stream input operator for any type that has operator<< defined for ostream.

Definition at line 67 of file Log.H.

References jevois::drawErrorImage(), jevois::logSetEngine(), jevois::warnAndIgnoreException(), and jevois::warnAndRethrowException().

◆ operator<<() [2/3]

template<int Level>
jevois::Log< Level > & jevois::Log< Level >::operator<< ( int8_t const &  out_item)

Overload of operator<< for int8 (displays it as an int rather than char)

Definition at line 166 of file Log.C.

◆ operator<<() [3/3]

template<int Level>
jevois::Log< Level > & jevois::Log< Level >::operator<< ( uint8_t const &  out_item)

Overload of operator<< for uint8 (displays it as an int rather than char)

Definition at line 158 of file Log.C.


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