core: notify plugins when a log line is emitted.
Currently make a plugin that do reportings of logs on a services like graphana is not possible. So this commit include the possibility to write a plugin that do the report of this analisys. Changelog-Added: core: notify plugins when a log line is emitted. Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
This commit is contained in:
committed by
Alex Myers
parent
5430b65b4c
commit
ce70167ead
15
common/plugin.c
Normal file
15
common/plugin.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "config.h"
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <common/plugin.h>
|
||||
|
||||
bool is_asterix_notification(const char *notification_name, const char *subscription)
|
||||
{
|
||||
bool is_special;
|
||||
/* Asterisk is magic "all", and log notification
|
||||
* is a special notification that must be turn on
|
||||
* only if requested. */
|
||||
is_special = streq(subscription, "*") && !streq(notification_name, "log");
|
||||
if (is_special)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user