PHP Класс MongoLog

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

getCallback() публичный статический Метод

(PECL mongo >= 1.3.0) Gets the previously set callback function
public static getCallback ( ) : callable | null
Результат callable | null

getLevel() публичный статический Метод

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
Результат integer Returns the current level

getModule() публичный статический Метод

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
Результат integer Returns the modules currently being logged

setCallback() публичный статический Метод

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.

    Результат boolean Returns TRUE on success or FALSE on failure.

    setLevel() публичный статический Метод

    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
    Результат void

    setModule() публичный статический Метод

    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
    Результат void