PHP Class MongoLog

Mostra file Open project: alcaeus/mongo-php-adapter Class Usage Examples

Public Methods

Method 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 method

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

getLevel() public static method

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
return integer Returns the current level

getModule() public static method

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
return integer Returns the modules currently being logged

setCallback() public static method

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.

    return boolean Returns TRUE on success or FALSE on failure.

    setLevel() public static method

    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
    return void

    setModule() public static method

    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
    return void