SHARE
TWEET

Untitled

a guest Jul 17th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "monitor.h"
  2.  
  3. core::monitor::monitor(void) {
  4.     this->baseName = "monitor";
  5. }
  6.  
  7. core::monitor::~monitor(void) {
  8. }
  9.  
  10. int core::monitor::init(void) {
  11.     this->addHook(MSG_SYS_LOG_INFO, &core::monitor::cb_log, this);
  12.  
  13.     return 0;
  14. }
  15.  
  16. int core::monitor::cb_log(const message::core::msg * const rawmsg) {
  17.     auto const msg = (message::core::sys_log_info *)rawmsg;
  18.  
  19.     logs_td logs;
  20.     logs << "I got a message and it says '" << msg->getText() << "'!";
  21.     this->log(&logs);
  22.     return 0;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top