20bool yarp::os::impl::LogForwarder::started{
false};
27void yarp::os::impl::ThreadedPort::ThreadedPort::run()
33 size = messages.size();
35 if (size > 0 && m_port) { process(); }
40void yarp::os::impl::ThreadedPort::process()
73 messages.push_front(bot);
88yarp::os::impl::LogForwarder::LogForwarder()
96 outputPort.setWriteOnly();
97 std::string
logPortName =
"/log/" + std::string(hostname) +
108 outputPort.addOutput(
"/yarplogger",
"fast_tcp");
109 tport.attach(&outputPort);
116 return outputPort.getName();
123 std::string port =
"[" + outputPort.
getName() +
"]";
133 std::ostringstream
ost;
137 ost <<
"(level INFO)";
142 fw.forward(
ost.str());
147 fw.tport.terminate();
A simple collection of objects that can be described and transmitted in a portable way.
void clear()
Empties the bottle of any objects it contains.
bool write(ConnectionWriter &writer) const override
Output a representation of the bottle to a network connection.
void addString(const char *str)
Places a string in the bottle, at the end of the list.
A mini-server for performing network communication in the background.
std::string getName() const override
Get name of port.
void close() override
Stop port activity.
void interrupt() override
Interrupt any current reads or writes attached to the port.
bool isWriting() override
Report whether the port is currently writing data.
static bool isNetworkInitialized()
An abstraction for a periodic thread.
bool start()
Call this to start the thread.
static double nowSystem()
static void delaySystem(double seconds)
static ProcessInfo getProcessInfo(int pid=0)
gets the operating system process information given by its PID.
void forward(const std::string &message)
std::string getLogPortName()
static LogForwarder & getInstance()
void attach(yarp::os::BufferedPort< yarp::os::Bottle > *port)
void insert(const yarp::os::Bottle &bot)
std::string get_string(const std::string &key, bool *found=nullptr)
Read a string from an environment variable.
std::string to_string(IntegerType x)
double now()
Return the current time in seconds, relative to an arbitrary starting point.
bool isSystemClock()
Check if YARP is providing system time.
std::string gethostname()
Portable wrapper for the gethostname() function.
The main, catch-all namespace for YARP.
The ProcessInfo struct provides the operating system process information.