Skip to content

Integrate hclog - #155

Open
egourlao wants to merge 1 commit into
hashicorp:masterfrom
egourlao:master
Open

Integrate hclog#155
egourlao wants to merge 1 commit into
hashicorp:masterfrom
egourlao:master

Conversation

@egourlao

Copy link
Copy Markdown

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

hashicorp-cla commented Dec 6, 2019

Copy link
Copy Markdown

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 have already 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

tyndyll commented Sep 23, 2020

Copy link
Copy Markdown

Is there any way to move this forward?

@dnephin

dnephin commented Sep 24, 2020

Copy link
Copy Markdown
Contributor

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.

4 participants