![]() |
Plasma Engine
2.0
|
This is the standard log system that plLog sends all messages to. More...
#include <Log.h>
Public Member Functions | |
virtual void | HandleLogMessage (const plLoggingEventData &le) override |
Override this function to handle logging events. | |
![]() | |
PL_ALWAYS_INLINE void | SetLogLevel (plLogMsgType::Enum logLevel) |
LogLevel is between plLogEventType::None and plLogEventType::All and defines which messages will be logged and which will be filtered out. | |
PL_ALWAYS_INLINE plLogMsgType::Enum | GetLogLevel () |
Returns the currently set log level. | |
Static Public Member Functions | |
static plEventSubscriptionID | AddLogWriter (plLoggingEvent::Handler handler) |
Allows to register a function as an event receiver. | |
static void | RemoveLogWriter (plLoggingEvent::Handler handler) |
Unregisters a previously registered receiver. It is an error to unregister a receiver that was not registered. | |
static void | RemoveLogWriter (plEventSubscriptionID &ref_subscriptionID) |
Unregisters a previously registered receiver. It is an error to unregister a receiver that was not registered. | |
static plUInt32 | GetMessageCount (plLogMsgType::Enum messageType) |
Returns how many message of the given type occurred. | |
static void | SetGlobalLogOverride (plLogInterface *pInterface) |
Friends | |
class | plLog |
This is the standard log system that plLog sends all messages to.
It allows to register log writers, such that you can be informed of all log messages and write them to different outputs.
|
overridevirtual |
Override this function to handle logging events.
Implements plLogInterface.
|
static |
plLogInterfaces are thread_local and therefore a dedicated plGlobalLog is created per thread. Especially during testing one may want to replace the log system everywhere, to catch certain messages, no matter on which thread they happen. Unfortunately that is not so easy, as one cannot modify the thread_local system for all the other threads. This function makes it possible to at least force all messages that go through any plGlobalLog to be redirected to one other log interface. Be aware that that interface has to be thread-safe. Also, only one override can be set at a time, SetGlobalLogOverride() will assert that no other override is set at the moment.