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

Adapt libp2p logger to our logging system #4531

Closed
kostko opened this issue Mar 2, 2022 · 2 comments · Fixed by #4547
Closed

Adapt libp2p logger to our logging system #4531

kostko opened this issue Mar 2, 2022 · 2 comments · Fixed by #4547
Assignees
Labels
c:p2p Category: P2P

Comments

@kostko
Copy link
Member

kostko commented Mar 2, 2022

We should add an adapter for the libp2p logger so that all the logs are collected in one place.

@kostko kostko added the c:p2p Category: P2P label Mar 2, 2022
@ptrus ptrus self-assigned this Mar 4, 2022
@Yawning
Copy link
Contributor

Yawning commented Mar 7, 2022

go/common/logging has this:

	// libp2p/IPFS uses yet another logging library, that appears to be a
	// wrapper around go-logging.  Because it's quality IPFS code, it's
	// configured via env vars, from the package `init()`.
	//
	// Till we can write a nice wrapper around it, to make it do what we
	// want, reach into the underlying library and squelch it.
	goLogging.Reset()
	_ = goLogging.SetBackend(goLogging.NewLogBackend(ioutil.Discard, "libp2p", goLog.LstdFlags))

But if we are getting logs, then they must have changed things when we weren't looking.

@ptrus
Copy link
Member

ptrus commented Mar 7, 2022

Yes the ipfs logger is a wrapper around zap now, and it's somewhat configurable: https://github.com/ipfs/go-log/blob/604185d3545622df35d1bb76100bfc8b04293f9b/setup.go#L160-L162

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:p2p Category: P2P
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants