Library: Foundation
Package: Logging
Header: Poco/LogStream.h
Description
This class implements a streambuf interface to a Logger.
The streambuf appends all characters written to it to a string. As soon as a CR or LF (std::endl) is written, the string is sent to the Logger, with the set priority.
Inheritance
Direct Base Classes: UnbufferedStreamBuf
All Base Classes: UnbufferedStreamBuf
Member Summary
Member Functions: capacity, getPriority, logger, reserve, setPriority
Constructors
LogStreamBuf
LogStreamBuf(
Logger & logger,
Message::Priority priority,
std::size_t bufferCapacity = 0
);
Creates the LogStream.
Destructor
~LogStreamBuf
~LogStreamBuf();
Destroys the LogStream.
Member Functions
capacity
std::size_t capacity() const;
Returns the internal message buffer capacity.
getPriority
Message::Priority getPriority() const;
Returns the priority for log messages.
logger
Logger & logger() const;
Returns a reference to the Logger.
reserve
void reserve(
std::size_t capacity
);
Sets the capacity of the internal message buffer to the given size.
setPriority
void setPriority(
Message::Priority priority
);
Sets the priority for log messages.