|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
9 #ifndef YARP_OS_LOGSTREAM_H
10 #define YARP_OS_LOGSTREAM_H
30 std::ostream&
operator<<(std::ostream& os,
const std::vector<T>&
t);
59 std::ostringstream oss;
77 const double externaltime,
80 stream(new Stream(type, file, line, func, externaltime, pred, comp))
93 if (!stream->pred || stream->pred()) {
94 std::string s = stream->oss.str();
99 if (s.back() ==
' ') {
102 yarp::os::Log(stream->file, stream->line, stream->func,
nullptr, yarp::os::Log::logInternalComponent()).
warning(
103 "' ' was expected. Some `operator<<` does not add an extra space at the end");
106 if (s.back() ==
'\n') {
107 yarp::os::Log(stream->file, stream->line, stream->func,
nullptr, yarp::os::Log::logInternalComponent()).
warning(
108 "Removing extra \\n (stream-style)");
112 Log::do_log(stream->type,
119 stream->externaltime,
134 stream->oss << (
t ?
"true" :
"false");
219 stream->oss <<
t.c_str();
224 template <
typename T>
237 template <
typename T>
241 for (
typename std::vector<T>::const_iterator it =
t.begin(); it !=
t.end(); ++it) {
243 if (it !=
t.begin()) {
252 #endif // YARP_OS_LOGSTREAM_H
LogStream & operator<<(const std::vector< T > &t)
std::ostream & operator<<(std::ostream &os, StrStream &sstr)
LogStream & operator<<(unsigned short t)
LogStream & operator<<(char t)
void warning(const char *msg,...) const
LogStream & operator<<(float t)
LogStream & operator<<(signed int t)
LogStream & operator<<(bool t)
LogStream & operator<<(unsigned int t)
LogStream & operator<<(signed short t)
double now()
Return the current time in seconds, relative to an arbitrary starting point.
static double nowSystem()
LogStream & operator<<(double t)
LogStream(Log::LogType type, const char *file, unsigned int line, const char *func, const double externaltime, const yarp::os::Log::Predicate pred=nullptr, const LogComponent &comp=Log::defaultLogComponent())
LogStream & operator<<(const std::string &t)
void yarp_print_trace(FILE *out, const char *file, unsigned int line)
Low level function for printing a stack trace, if implemented (ACE or gcc/Linux).
LogStream & operator<<(unsigned long t)
LogStream & operator<<(unsigned long long t)
LogStream & operator<<(const char *t)
The main, catch-all namespace for YARP.
bool isSystemClock()
Check if YARP is providing system time.
bool isClockInitialized()
Check if YARP clock is initialized.
LogStream & operator<<(signed long long t)
LogStream & operator<<(signed long t)
LogStream & operator<<(const void *t)
LogStream(const LogStream &o)