2024 年 PHP Conference Japan

Zookeeper::setDebugLevel

(PECL zookeeper >= 0.1.0)

Zookeeper::setDebugLevel設定程式庫的除錯等級

說明

public static Zookeeper::setDebugLevel(int $logLevel): bool

參數

logLevel

ZooKeeper 日誌等級常數。

傳回值

成功時返回 true,失敗時返回 false

錯誤/例外

當參數數量或類型錯誤,或設定除錯等級失敗時,此方法會發出 PHP 錯誤/警告。

注意事項

自 0.3.0 版起,此方法會發出 ZookeeperException 及其衍生例外。

範例

範例 #1 Zookeeper::setDebugLevel() 範例

設定除錯等級。

<?php
$r
= Zookeeper::setDebugLevel(Zookeeper::LOG_LEVEL_WARN);
if (
$r)
echo
'SUCCESS';
else
echo
'ERR';
?>
?>

以上範例將輸出

SUCCESS
新增註解

使用者貢獻的註解

此頁面沒有使用者貢獻的註解。
To Top