Hi Nilesh,

On Fri, 2023-11-17 at 16:45 +0530, Nilesh Patra wrote:
> On Fri, Nov 17, 2023 at 06:18:04PM +0800, Maytham Alsudany wrote:
> > golang-github-go-logfmt-logfmt doesn't have this Handler type that's being 
> > used,
> > and humanlog already uses go-logfmt as much as it can
> > 
> > I've made an issue upstream at [3] regarding this and I've patched out the
> > Handler type completely from humanlog for now.
> > 
> > Would you like me to close this RFS bug and the ITP?
> 
> If this is needed for some actual functionality in humanlog, I will upload 
> kr-logfmt
> which would otherwise block your work.

There's only one thing, a Go interface, in humanlog that uses kr-logfmt
functionality, but it is possible to patch out (as lazygit doesn't use it).

humanlog/handler.go[4]:

import (
        "github.com/humanlogio/humanlog/internal/pkg/config"
        "github.com/kr/logfmt"
)

// Handler can recognize it's log lines, parse them and prettify them.
type Handler interface {
        CanHandle(line []byte) bool
        Prettify(skipUnchanged bool) []byte
        logfmt.Handler
}

This is the only place kr-logfmt is used, and humanlog's Handler interface is
not used anywhere else within humanlog.

> From your mail, it is not clear to me whether or not it is needed.
> Please let me know.

Yes, it is needed, but I've let humanlog upstream and the lazygit packaging
effort know about your concerns.

I see two options:
  1. Patch out kr-logfmt out of humanlog, removing the single Handler interface
that uses it, and when a package needs the Handler interface from humanlog,    
we revist the issue.
  2. Upload kr-logfmt and package humanlog as usual.

> > [1]: https://bugs.debian.org/1055740
> > [2]:
> > https://salsa.debian.org/go-team/packages/golang-github-humanlogio-humanlog/
> > [3]: https://github.com/humanlogio/humanlog/issues/71
[4]:
https://github.com/humanlogio/humanlog/blob/eceedbf5df8383202e34d3aa4cb3d8dc182b3600/handler.go

Kind regards,
Maytham

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to