/** * (PECL mongo >= 1.3.0)<br/> * <p> * This function will set a callback function to be called for {@link http://www.php.net/manual/en/class.mongolog.php MongoLog} events * instead of triggering warnings. * </p> * @link http://www.php.net/manual/en/mongolog.setcallback.php * @param callable $log_function <p> * The function to be called on events. * </p> * <p> * The function should have the following prototype * </p> * * <em>log_function</em> ( <em>int</em> <em>$module</em> , <em>int</em> <em>$level</em>, <em>string</em> <em>$message</em>) * <ul> * <li> * <b><i>module</i></b> * * <p>One of the {@link http://www.php.net/manual/en/class.mongolog.php#mongolog.constants.module MongoLog module constants}.</p> * </li> * <li> * <b><i>level</i></b> * * <p>One of the {@link http://www.php.net/manual/en/class.mongolog.php#mongolog.constants.level MongoLog level constants}.</p> * </li * <li> * <b><i>message</i></b> * * <p>The log message itself.</p></li> * <ul> * @return boolean Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. */ public static function setCallback(callable $log_function) { self::$callback = $log_function; return true; }
/** * Set a callback function to be called on events * * @param callable $logFunction - The function to be called on events. * * @return void - */ public static function setCallback(callable $logFunction) { self::$callback = $logFunction; }