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

Integrate hclog #155

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Integrate hclog #155

wants to merge 1 commit into from

Conversation

egourlao
Copy link

With this pull request, memberlist uses hclog.Logger as logging interface.

Here are a few other changes that this commit integrates:

  • The Config and NetTransportConfig are changed, and now take directly the hclog.Logger object. If no object is passed, newMemberlist uses hclog.Default().
  • fromAddress and fromConn are now methods of a struct that embeds hclog.Logger.
    • Given that the way those methods are called has changed, tests have also changed.
  • To log errors, I drew inspiration from other projects using hclog and added them with the "err" field name.

@hashicorp-cla
Copy link

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


Eric Gourlaouen seems not to be a GitHub user.
You need a GitHub account to be able to sign the CLA. If you already have a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

@tyndyll
Copy link

tyndyll commented Sep 23, 2020

Is there any way to move this forward?

@dnephin
Copy link
Contributor

dnephin commented Sep 24, 2020

You can use hclog with memberlist by calling Logger.StandardLogger (https://pkg.go.dev/github.com/hashicorp/go-hclog#Logger), and passing that in as the Logger:

logger := hclog.New(nil)
logger.StandardLogger(&hclog.StandardLoggerOptions{InferLevels: true})

This PR seems to have many merge conflicts, so it would probably be easier to start from scratch. If someone were to do that, it might be preferable to accept an interface that can be satisfied by hclog instead.

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.

None yet

4 participants