Skip to content

Conversation

@truetech
Copy link
Contributor

While trying to emit from the standalone, write-only KombuManager (using the example from the docs), I kept running into this exception:

AttributeError: ‘NoneType’ object has no attribute ‘logger’

It looks like logging inside all of the client managers depends on the logger created when the server was instantiated, but that is None when the manager is used by itself in write-only mode. The test for write-only sets a mock server (and thus a default logger), so it doesn't fail in the tests.

This code should address that, creating a new option to set the logger for write-only managers, using the server logger if it exists, and falling back to the same default logger as the server. It also fixes what looks like a bug where KombuManager was not passing write_only up to the PubSubManager and adds a test to ensure loggers are being set. Logging in AsyncRedisManager was done a little differently; I'm not sure if that was intentional (no option, always default logger), but I made it consistent with the others.

@miguelgrinberg miguelgrinberg self-assigned this Jul 25, 2018
@miguelgrinberg miguelgrinberg merged commit da7cb86 into miguelgrinberg:master Oct 9, 2018
@miguelgrinberg
Copy link
Owner

Thanks, this is a nice improvement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants