PHP Class MongoLog

Afficher le fichier Open project: alcaeus/mongo-php-adapter Class Usage Examples

Méthodes publiques

Méthode Description
getCallback ( ) : callable | null (PECL mongo >= 1.3.0) Gets the previously set callback function
getLevel ( ) : integer This can be used to see the log level. Use the constants described in the MongoLog section with bitwise operators to check the level.
getModule ( ) : integer This function can be used to see which parts of the driver's functionality are being logged. Use the constants described in the MongoLog section with bitwise operators to check if specific modules are being logged.
setCallback ( callable $log_function ) : boolean (PECL mongo >= 1.3.0)

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.

setLevel ( integer $level ) : void This function can be used to set how verbose logging should be and the types of activities that should be logged. Use the constants described in the MongoLog section with bitwise operators to specify levels.
setModule ( integer $module ) : void This function can be used to set which parts of the driver's functionality should be logged. Use the constants described in the MongoLog section with bitwise operators to specify modules.

Method Details

getCallback() public static méthode

(PECL mongo >= 1.3.0) Gets the previously set callback function
public static getCallback ( ) : callable | null
Résultat callable | null

getLevel() public static méthode

This can be used to see the log level. Use the constants described in the MongoLog section with bitwise operators to check the level.
public static getLevel ( ) : integer
Résultat integer Returns the current level

getModule() public static méthode

This function can be used to see which parts of the driver's functionality are being logged. Use the constants described in the MongoLog section with bitwise operators to check if specific modules are being logged.
public static getModule ( ) : integer
Résultat integer Returns the modules currently being logged

setCallback() public static méthode

public static setCallback ( callable $log_function ) : boolean
$log_function callable

The function to be called on events.

The function should have the following prototype

log_function ( int $module , int $level, string $message)
  • module

    One of the {@link http://www.php.net/manual/en/class.mongolog.php#mongolog.constants.module MongoLog module constants}.

  • level

    One of the {@link http://www.php.net/manual/en/class.mongolog.php#mongolog.constants.level MongoLog level constants}.

  • message

    The log message itself.

    Résultat boolean Returns TRUE on success or FALSE on failure.

    setLevel() public static méthode

    This function can be used to set how verbose logging should be and the types of activities that should be logged. Use the constants described in the MongoLog section with bitwise operators to specify levels.
    public static setLevel ( integer $level ) : void
    $level integer The levels you would like to log
    Résultat void

    setModule() public static méthode

    This function can be used to set which parts of the driver's functionality should be logged. Use the constants described in the MongoLog section with bitwise operators to specify modules.
    public static setModule ( integer $module ) : void
    $module integer The module(s) you would like to log
    Résultat void