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()) {
std::ostream & operator<<(std::ostream &os, const std::vector< T > &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 short t)
LogStream & operator<<(const void *t)
LogStream & operator<<(unsigned int t)
LogStream & operator<<(const std::vector< T > &t)
LogStream & operator<<(char t)
LogStream & operator<<(bool t)
LogStream & operator<<(unsigned long long 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<<(double t)
LogStream & operator<<(unsigned long t)
LogStream & operator<<(float t)
LogStream & operator<<(const std::string &t)
LogStream & operator<<(signed long long t)
LogStream & operator<<(const char *t)
LogStream & operator<<(signed int t)
LogStream(const LogStream &o)
LogStream & operator<<(signed short t)
LogStream & operator<<(signed long t)
void warning(const char *msg,...) const
static double nowSystem()
bool isClockInitialized()
Check if YARP clock is initialized.
double now()
Return the current time in seconds, relative to an arbitrary starting point.
bool isSystemClock()
Check if YARP is providing system time.
The main, catch-all namespace for YARP.