-
Notifications
You must be signed in to change notification settings - Fork 6
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
Use structured logging #29
Conversation
src/template_compiler.erl
Outdated
@@ -196,7 +196,7 @@ block_lookup({ok, TplFile}, BlockMap, ExtendsStack, DebugTrace, Options, Vars, R | |||
case lists:member(Module, ExtendsStack) of | |||
true -> | |||
FileTrace = [Module:filename() | [ M:filename() || M <- ExtendsStack ]], | |||
?LOG_ERROR("[template_compiler] Template recursion: ~p", [FileTrace]), | |||
?LOG_ERROR(#{ text => "Template recursion.", trace => FileTrace}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an idea, could we transform the trace to a stack trace format? Then the logger can show it as a stack trace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably.. I want to change the yecc errors top maps as well. That will probably improve the readability. Not sure what a filetrace looks like tbh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great, the Yecc errors are quite confusing. We should be able to see in one go what the problem is and where.
src/template_compiler.erl
Outdated
Error | ||
end; | ||
error -> | ||
?LOG_ERROR("Error compiling forms for ~p", [Filename]), | ||
?LOG_ERROR(#{ text => "Error compiling forms.", filename => Filename}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the other logging I always added result => error
and then, if known, reason => ...
f43c21b
to
1d7f4b1
Compare
Rebased on master |
Co-authored-by: Viacheslav Katsuba <v.katsuba.dev@gmail.com>
Yeah nice... Only the yecc errors are still confusing. :p |
Co-authored-by: Viacheslav Katsuba <v.katsuba.dev@gmail.com>
Co-authored-by: Viacheslav Katsuba <v.katsuba.dev@gmail.com>
Co-authored-by: Viacheslav Katsuba <v.katsuba.dev@gmail.com>
Co-authored-by: Viacheslav Katsuba <v.katsuba.dev@gmail.com>
Co-authored-by: Viacheslav Katsuba <v.katsuba.dev@gmail.com>
Co-authored-by: Viacheslav Katsuba <v.katsuba.dev@gmail.com>
Co-authored-by: Viacheslav Katsuba <v.katsuba.dev@gmail.com>
Co-authored-by: Viacheslav Katsuba <v.katsuba.dev@gmail.com>
This PR changes log messages to structured logging format.