Wt
4.11.1
|
An abstract log sink. More...
#include <Wt/WLogSink.h>
Public Member Functions | |
virtual void | log (const std::string &type, const std::string &scope, const std::string &message) const noexcept=0 |
Logs a message. More... | |
virtual bool | logging (const std::string &type, const std::string &scope) const noexcept |
Returns whether messages of the given type should be logged. More... | |
An abstract log sink.
You can implement this to redirect Wt or Wt::Dbo's logging to another logging system.
For Wt, you can configure the logger on a WServer level using WServer::setCustomLogger(). For Wt::Dbo, you can configure the logger globally using Wt::Dbo::setCustomLogger().
|
pure virtualnoexcept |
Logs a message.
type | The type of the log message (e.g. debug, info, ...) |
scope | The scope of the message (e.g. WWidget, wthttp, ...) |
message | The message itself (usually starts with the scope too) |
|
virtualnoexcept |
Returns whether messages of the given type should be logged.
type | The type of the log message (e.g. debug, info, ...) |
scope | The scope of the message (e.g. WWidget, wthttp, ...) |
The default implementation always returns true. You can reimplement this as an optimization: if the underlying logger doesn't log messages of a certain type, then Wt does not need to generate the log message.