Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "monitor.h"
- core::monitor::monitor(void) {
- this->baseName = "monitor";
- }
- core::monitor::~monitor(void) {
- }
- int core::monitor::init(void) {
- this->addHook(MSG_SYS_LOG_INFO, &core::monitor::cb_log, this);
- return 0;
- }
- int core::monitor::cb_log(const message::core::msg * const rawmsg) {
- auto const msg = (message::core::sys_log_info *)rawmsg;
- logs_td logs;
- logs << "I got a message and it says '" << msg->getText() << "'!";
- this->log(&logs);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement