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

PHPLIB-1243: Document add/remove logger functions #1191

Merged
merged 2 commits into from
Nov 9, 2023

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Nov 9, 2023

@jmikola jmikola requested review from alcaeus and GromNaN November 9, 2023 00:12
@@ -0,0 +1,11 @@
arg_name: param
name: $logger
type: Psr\\Log\\LoggerInterface
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For "reasons", we can't use a URL here. I tried:

`Psr\Log\LoggerInterface <https://www.php-fig.org/psr/psr-3/#3-psrlogloggerinterface>`__

Giza complains about a leading backtick character. Text roles (e.g. :php:) work, but we don't have one for the PSR website.

I was able to specify a URL when also using multi-line string syntax (e.g. type: |), but that appends a trailing " or" to the output. I expect there's something in the build system that supports multiple types on separate lines -- which we've never used since we typically write "array|object".

Anyway, the PSR website is linked from the main doc page so this isn't a huge problem.

objects to receive log messages from libmongoc and the driver. Each registered
logger will receive messages for *all* clients.

Messages originating from libmongoc will have their log level translated to an
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"libmongoc" is something for insiders. What do you think of the more abstract word "driver" or "extension".

Suggested change
Messages originating from libmongoc will have their log level translated to an
Messages originating from the mongodb extension will have their log level translated to an

Reading this, I'd be interested to know what the mapping is, so that I know which types of messages I'm going to receive on which levels.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually linking to the libmongoc docs below as that's the canonical reference for its log levels. Users are going to be exposed to libmongoc either way, as that's where the domain strings come from.

No objection changing this to the extension, though. This also relates to PHPLIB-1279.

This all makes we wish we could require users to complete a quick modal popup before landing on the docs and have them acknowledge that the "driver" consists of a PHP library, PHP extension, and libmongoc. It would use a cookie and attempt to be a one-time thing -- but that would probably land us in a quandary of then needing some silly GDPR cookie interstitial, which in my experience happens every time. Alas.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, let's not confront European legislation and let readers learn at their own pace.

Thanks for the update.

Copy link
Member

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

objects to receive log messages from libmongoc and the driver. Each registered
logger will receive messages for *all* clients.

Messages originating from libmongoc will have their log level translated to an
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, let's not confront European legislation and let readers learn at their own pace.

Thanks for the update.

@jmikola jmikola merged commit a5657d7 into mongodb:master Nov 9, 2023
@jmikola jmikola deleted the phplib-1243 branch November 9, 2023 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants