-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
AttributeError when deepcopying object using structlog #268
Comments
Yeah I suppose we'll have to implement an |
Any way I can help with this? |
You could submit a PR that does it? 😇 Shouldn't be too complicated, I think. The bigger problem will probably be to hunt down all classes that need this treatment. 🤔 |
Hm, fixing PrintLogger worked, but I still get errors: #270 Do you have any idea what the cause could be? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I really like
structlog
and have been using it in my classes like this:This way I have separate loggers for different objects to which I can bind different attributes (here
id
). And it used to work fine.Now, I need to deepcopy my objects and it breaks:
This fails with the following error:
AttributeError: 'PrintLogger' object has no attribute '__deepcopy__'
Is there some other best practice how to use
structlog
with classes and objects? Or some way to fix the problem?This seems related to #126 and #71.
I have
structlog 20.1.0
with Python 3.8 on Ubuntu 20.04 (on WSL on Win 10).The text was updated successfully, but these errors were encountered: