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

Why GELFHandler is deprecated? #105

Closed
Urahara opened this issue Mar 20, 2019 · 6 comments
Closed

Why GELFHandler is deprecated? #105

Urahara opened this issue Mar 20, 2019 · 6 comments
Assignees

Comments

@Urahara
Copy link

Urahara commented Mar 20, 2019

I just run pip install graypy today on new machine that i using and them a get this error on older project.

AttributeError: module 'graypy' has no attribute 'GELFHandler'
@nklapste
Copy link
Collaborator

nklapste commented Mar 20, 2019

Sorry for breaking compatibility, GELFHandler has been replaced with GELFUDPHandler to be more explicit on its implementation (and possibly highlighting the potential issues with sending logs via UDP).

Note: Similar changes were done with GELFTcpHandler being restructured into GELFTCPHandler and GELFTLSHandler to improve explicitness.

Any version of graypy 0.X.X should support the old definition of GELFHandler and GELFTcpHandler. Any version of 1.X.X does not support GELFHandler and GELFTcpHandler.

@nklapste nklapste self-assigned this Mar 20, 2019
@nklapste
Copy link
Collaborator

@Urahara see #106 for a possible solution to improve backwards compatibility from 0.3.X to 1.X.X.

Though I'm not 100% sold on adding back class aliases that are immediately deprecated and are likely to be removed anyways within the future. If demand is high enough I can implement these changes, but, otherwise it might be easier to either update your older projects, or simply lock requirements of graypy to 0.3.X.

@Urahara
Copy link
Author

Urahara commented Mar 20, 2019

@nklapste Thanks for clarify! What surprised me was that there were several releases in the last few days and i didn't know where these changes occurred. I think it would be nice to have this backward compatibility like you implemented on #106 using warning to notify users that GELFHandler was deprecated.

@nklapste
Copy link
Collaborator

@Urahara The removal of GELFHandler was first done within 1.0.0

Adding backwards compatibility for GELFHandler is relatively easy and I'm okay with adding such functionality.

However, a similar case for GELFTcpHandler is currently having issues with making a straightforward port (mainly due to its method of creating a TLS socket in some cases). Likely GELFTcpHandler is going to be completely unsupported in 1.X.X.

@Urahara
Copy link
Author

Urahara commented Mar 20, 2019

I understand, but i think that who is having issues with GELFTcpHandler probably will update to use new definition.

@nklapste
Copy link
Collaborator

nklapste commented Mar 20, 2019

Looking at the changes needed to accommodate backporting (see #108 and #106) and how they directly invalidate the API breaking notation of bumping graypy's version to 1.X.X. I think its better to not resolve the breaking changes introduced 1.X.X.

Additionally, since in graypy 0.3.X BaseGELFHandler did not inherit from a python logging.Handler (1.X.X does) there is possibility that unintentional behavior could be experienced with inheriting classes such as GELFHandler. To avoid unexpected behavior from upgrading to 1.X.X GELFHandler (and GELFTcpHandler) were removed.

If you wish to still use the GELFHandler notation I would recommend locking your requirements or forcefully installing a older version of graypy after installing your old project (e.g. pip install -I graypy==0.3.2).

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

No branches or pull requests

2 participants