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

consider sharing structured error log as function #787

Open
ldemailly opened this issue Jul 3, 2023 · 0 comments
Open

consider sharing structured error log as function #787

ldemailly opened this issue Jul 3, 2023 · 0 comments

Comments

@ldemailly
Copy link
Member

ldemailly commented Jul 3, 2023

From Wiard

"It took me (too) long to realise that you are setting err here for line 383 if I'm honest. Same goes for the logic at line 394.

I do understand you want to reuse the contex of the logger... but then maybe make a small func as in "return err with context" and then do something like"

return nil, returnErrorWithContext("invalid url")

where returnErrorWithContext func is the contents of:

		log.S(log.Error, "Unable to make request",
			log.Attr("method", method), log.Attr("url", o.URL), log.Attr("err", err),
			log.Attr("thread", o.ID), log.Attr("run", o.UniqueID))

Originally posted by @wiardvanrij in #785 (comment)

see thread

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

1 participant