php - 下载文件时抑制错误消息

标签 php error-handling docusignapi

我目前正在将PHP客户端用于docusign(https://github.com/docusign/docusign-php-client),每次调用DocuSign\eSign\Api\EnvelopesApi::getDocument时,都会收到类似以下的消息

[INFO] Written ##### byte to /tmp/######. Please move the file to a proper folder or delete the temp file after processing.

这显然是由该行(https://github.com/docusign/docusign-php-client/blob/master/src/ObjectSerializer.php#L260)触发的
error_log("[INFO] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.\n", 3, Configuration::getDefaultConfiguration()->getDebugFile());

我尝试了所有我能想到的所有事情,使用@,将error_reporting设置为0,将debugfile设置为php://stderr,设置为/dev/null,但都无济于事。

我在自定义Symfony命令的上下文中使用此方法(如果有什么用)。

最佳答案

SDK会将这些文本作为引用消息输出到系统日志。我了解您不愿看到它的愿望。 I have filed an issue against the SDK about this.

同时,我建议您git fork SDK并注释掉该行。

关于php - 下载文件时抑制错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40386390/

相关文章:

PHP 日期未以正确的格式插入

php - 在屏幕上显示用户的用户名。出现 'Undefined Index' 错误

ruby-on-rails - config.exceptions_app 在 rails 中不工作

docusignapi - 获取信封地址

docusignapi - 适用于 Power Automate 和 Power Apps 的 Docusign 自定义连接器

php - WordPress REST API 响应时间慢

php - 简单的联系表格邮件

JavaScript/TypeScript : Standard way to keep the cause of an Error

swift - “ fatal error :在展开可选值时意外发现nil”是什么意思?

html - Docusign 远程电子邮件按钮边框