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

Logging panic #6

Closed
asmaloney opened this issue Aug 20, 2021 · 2 comments
Closed

Logging panic #6

asmaloney opened this issue Aug 20, 2021 · 2 comments

Comments

@asmaloney
Copy link
Contributor

asmaloney commented Aug 20, 2021

After a panic the first time I tried to do anything basic, I read through issue #2 and see that we need to call logging.Configure() somewhere, but when I try that I get a different panic:

func main() {
	logging.Configure(1, nil)
...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x1098a03]

goroutine 1 [running]:
github.com/tliron/kutil/logging.Configure(...)
	vendor/github.com/tliron/kutil/logging/api.go:15
main.main()
	main.go:22 +0x83

Looking at the logging implementation, it seems like SetBackend() needs to be called somewhere as well? I'm not seeing where it is called in puccini.

Thanks!

@tliron
Copy link
Owner

tliron commented Aug 20, 2021

I know that documentation is severely lacking right now. :( But what you do is need to do is add a backend implementation in your imports. Example:

import (
    _ "github.com/tliron/kutil/logging/simple"
)

@asmaloney
Copy link
Contributor Author

Thanks Tal!

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

No branches or pull requests

2 participants