kubo icon indicating copy to clipboard operation
kubo copied to clipboard

Switch to go-log v2

Open aschmahmann opened this issue 3 years ago • 4 comments

Checklist

  • [X] My issue is specific & actionable.
  • [X] I am not suggesting a protocol enhancement.
  • [X] I have searched on the issue tracker for my issue.

Description

https://github.com/ipfs/go-log v2 has been out for quite a while now and go-libp2p v0.18.0 (the biggest source of go-log v1 outputs) is switching over to v2. We should too so that it can finally be deprecated.

This will also lead to the output of ipfs log tail becoming effectively useless which is largely happening anyway as a result of other components (e.g. go-libp2p) dropping support for go-log v1. This gives us an opportunity to make ipfs log tail more useful. For example, mirroring the daemon log output via ipfs log tail so it can be fetched over the HTTP API and doesn't have to track all log outputs just those from while the command is running.

cc @lidel @guseggert

aschmahmann avatar Mar 01 '22 09:03 aschmahmann

:+1 for making /api/v0/log/tail useful over HTTP

My wishlist is short:

  • ability to log/tail by level (DEBUG/INFO/WARN/ERROR)
  • ability to log/tail by subsystem (

It will enable us to add log explorer with filtering per system in ipfs-webui / ipfs-desktop (cc @SgtPooki)

lidel avatar Mar 01 '22 15:03 lidel

@aschmahmann : is this a good candidate for @schomatis ?

BigLep avatar Mar 01 '22 23:03 BigLep

Sounds like it. Will go ahead with this one unless explicitly flagged otherwise.

schomatis avatar Mar 02 '22 18:03 schomatis

Yep seems reasonable. We should probably use the go-log format (https://github.com/ipfs/go-log#golog_log_level) for describing particular subsystems to get logs for though.

aschmahmann avatar Mar 02 '22 18:03 aschmahmann