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

Add support for enum string parameters #36

Open
johns1342 opened this issue Dec 6, 2017 · 0 comments
Open

Add support for enum string parameters #36

johns1342 opened this issue Dec 6, 2017 · 0 comments

Comments

@johns1342
Copy link

For configuring logging with YAML, it would be convenient to add support for enum strings for auth_type and index_name_frequency. By changing this line for auth_type in CMRESHandler.__init__() the code can take advantage of enum's support for string lookups:

        #self.auth_type = auth_type
        if isinstance(auth_type, CMRESHandler.AuthType):
            self.auth_type = auth_type
        else:
            try:
                self.auth_type = CMRESHandler.AuthType[auth_type]
            except KeyError:
                # preserve old behavior
                pass

P.S. Thank you for the package! It's been a great help for improving our Python logging.

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

1 participant