JeVois  1.22
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
Loading...
Searching...
No Matches
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.
 
 ~Log ()
 Close the Log, outputting the aggregated message.
 
template<class T >
Log< Level > & operator<< (T const &out_item)
 Overloaded stream input operator for any type that has operator<< defined for ostream.
 
Log< Level > & operator<< (uint8_t const &out_item)
 Overload of operator<< for uint8 (displays it as an int rather than char)
 
Log< Level > & operator<< (int8_t const &out_item)
 Overload of operator<< for int8 (displays it as an int rather than char)
 
 Log (char const *, char const *, 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 150 of file Log.C.

◆ ~Log()

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

Close the Log, outputting the aggregated message.

Definition at line 178 of file Log.C.

◆ Log() [2/2]

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

Definition at line 44 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 178 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 63 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 178 of file Log.C.


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