hookEvents(); } /** * Allows external code to access logger instance. * Usage: * * Adeptus::logEvent([ * 'alert_code' => 10000, * 'alert_level' => \Psr\Log\LogLevel::INFO, * 'alert_title' => "Test", * 'alert_description' => "Test description", * 'sensor' => "TestSensor", * 'post_id' => 1234 // Additional property * ]); */ class Adeptus { private function __construct() { // Static class } /** * Log new event * @param array $payload Associative array of data to log * should contain the following properties * - alert_code * - alert_level * - alert_title * - alert_description * - sensor * @return void */ public static function logEvent(array $payload = array()) { global $adeptus_alertManager; if (isset($adeptus_alertManager)) { $adeptus_alertManager->event($payload); } } /** * Disable logging * When disabled no events will be captured. * @return void */ public static function disableLogging() { global $adeptus_alertManager; if (isset($adeptus_alertManager)) { $adeptus_alertManager->disableLogging(); } } /** * Enable logging * @return void */ public static function enableLogging() { global $adeptus_alertManager; if (isset($adeptus_alertManager)) { $adeptus_alertManager->enableLogging(); } } }