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

Extend skogul.Identity and merge with logging #234

Open
KristianLyng opened this issue May 20, 2022 · 0 comments
Open

Extend skogul.Identity and merge with logging #234

KristianLyng opened this issue May 20, 2022 · 0 comments
Labels
core/config Anything dealing with the configuration subsystem core/modules Anything dealing with the general module support enhancement New feature or request

Comments

@KristianLyng
Copy link
Collaborator

What I want is for modules to be able to have something like:

func (f *Foo) Send(...) ... {
    skogul.Log(f, "whatever")
}

and have skogul.Log look up f to find the name, which we have now, but also the family (receiver/sender/etc) and implementation (http/net/file/sql). It would significantly reduce boilerplate for logging and at the same time enrich the log data noticeably.

Or something of the like. It means slightly extending skogul.Identity, which really isn't a problem. Today, it's map[interface{}]string, if instead, we add a ModuleIdentity type:

type ModuleIdentity struct {
    Name string
    Family string
    Implementation *skogul.Module
}

That could be used instead (slightly unsure about Implementation, but worth considering). I imagine there are other benefits too.

@KristianLyng KristianLyng added enhancement New feature or request core/config Anything dealing with the configuration subsystem core/modules Anything dealing with the general module support labels May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core/config Anything dealing with the configuration subsystem core/modules Anything dealing with the general module support enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant