Receives formatted log messages. Subclass this to route OpenVDB diagnostics into a host application.
More...
Receives formatted log messages. Subclass this to route OpenVDB diagnostics into a host application.
Sinks are called on the thread that logged the message, so an implementation must be thread safe. A sink must not throw.
- Example
class MySink: public openvdb::logging::Sink
{
public:
MySink():
Sink(
"mysink") {}
void append(openvdb::logging::Level level, const std::string& message,
const char* file, int line) override
{
}
};
openvdb::logging::addSink(std::make_shared<MySink>());
Sink(const std::string &name, Level threshold=Level::Debug)