JeVois  1.0
JeVois Smart Embedded Machine Vision Toolkit
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 54 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

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 118 of file Log.C.

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

Close the Log, outputting the aggregated message.

Definition at line 146 of file Log.C.

Member Function Documentation

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 66 of file Log.H.

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 164 of file Log.C.

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 156 of file Log.C.


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