略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: MongoLog::getModule

2024-12-23

MongoLog::getModule

(PECL mongo >= 1.2.3)

MongoLog::getModuleGets the module(s) currently being logged

说明

public static MongoLog::getModule ( void ) : int

This function can be used to see which driver modules are currently being logged. The returned integer may be compared with the MongoLog module constants using bitwise operators to check if specific modules are being logged.

<?php

if (MongoLog::getModule() & MongoLog::RS) {
    echo 
"logging replica sets\n";
}

if (
MongoLog::getModule() ^ MongoLog::NONE) {
    echo 
"logging something\n";
}

if ((
MongoLog::getModule() & MongoLog::IO) == 0) {
    echo 
"not logging io\n";
}

?>

参数

此函数没有参数。

返回值

Returns the module(s) currently being logged.

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/mongolog.getmodule.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3