JeVois  1.20
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...
 
 Log (char const *JEVOIS_UNUSED_PARAM(fullFileName), char const *JEVOIS_UNUSED_PARAM(functionName), std::string *outstr)
 

Constructor & Destructor Documentation

◆ Log() [1/2]

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

◆ ~Log()

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

Close the Log, outputting the aggregated message.

Definition at line 167 of file Log.C.

◆ Log() [2/2]

jevois::Log< LOG_ALERT >::Log ( char const *  JEVOIS_UNUSED_PARAMfullFileName,
char const *  JEVOIS_UNUSED_PARAMfunctionName,
std::string *  outstr 
)

Definition at line 145 of file Log.C.

Member Function Documentation

◆ operator<<() [1/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 185 of file Log.C.

◆ operator<<() [2/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.

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


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