Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default BatchTrait debug output will not write to stderr as expected #672

Closed
chingor13 opened this issue Sep 15, 2017 · 3 comments
Closed
Assignees
Labels
api: core type: question Request for information or clarification. Not an issue.

Comments

@chingor13
Copy link
Contributor

See:

The STDERR constant is only available in the php CLI. The send method will generally be called from the web server (for logging, publishing, etc).

You end up with notices and warnings like:

<b>Notice</b>:  Use of undefined constant STDERR - assumed 'STDERR' in <b><PATH>/google-cloud-php/src/Core/Batch/BatchTrait.php</b> on line <b>107</b><br />
<br />
<b>Warning</b>:  fwrite() expects parameter 1 to be resource, string given in <b><PATH>/google-cloud-php/src/Core/Batch/BatchTrait.php</b> on line <b>111</b><br />
<br />
<b>Notice</b>:  Use of undefined constant STDERR - assumed 'STDERR' in <b><PATH>/google-cloud-php/src/Core/Batch/BatchTrait.php</b> on line <b>116</b><br />
<br />
<b>Warning</b>:  fwrite() expects parameter 1 to be resource, string given in <b><PATH>/google-cloud-php/src/Core/Batch/BatchTrait.php</b> on line <b>118</b><br />
@dwsupplee dwsupplee added api: core type: question Request for information or clarification. Not an issue. labels Sep 15, 2017
@dwsupplee
Copy link
Contributor

Thank you for the report @chingor13.

We have a notice in the documentation regarding this:

https://github.com/GoogleCloudPlatform/google-cloud-php/blob/5a437c8add2d18ff82b15d9e8303ea99a58e627e/src/Core/Batch/BatchTrait.php#L141-L143

I do agree that either way, however, this isn't ideal. I believe it would be best to provide a more thorough avenue to manage debug output. One thing we have considered is providing the ability to input a PSR-3 based logger. For a little more context, we have #586. We hope to flesh this out more soon!

@michaelbausor
Copy link
Contributor

@dwsupplee should we convert this to a bug or feature request?

@dwsupplee
Copy link
Contributor

I believe this should be listed as a feature request, adding it to the wiki.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: core type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

3 participants