20bool yarp::os::impl::LogForwarder::started{
false};
30yarp::os::impl::LogForwarder::LogForwarder()
38 outputPort.setWriteOnly();
39 std::string
logPortName =
"/log/" + std::string(hostname) +
49 outputPort.enableBackgroundWrite(
true);
50 outputPort.addOutput(
"/yarplogger",
"fast_tcp");
60 std::string port =
"[" + outputPort.
getName() +
"]";
70 std::ostringstream
ost;
74 ost <<
"(level INFO)";
79 fw.forward(
ost.str());
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.
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.
void write(bool forceStrict=false)
Write the current object being returned by BufferedPort::prepare.
static bool isNetworkInitialized()
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)
static LogForwarder & getInstance()
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 ProcessInfo struct provides the operating system process information.