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

Can the log method only log the format error instead of throw the exception? #87

Open
lsxia opened this issue Nov 13, 2023 · 2 comments

Comments

@lsxia
Copy link

lsxia commented Nov 13, 2023

It is not that uncommon for developers to miss a "{}" in for format string, which caused format_error exception at runtime. The malformed line logging code may crash the entire application, which is not desirable. Should we only log the format_error and the line number that has the format error without crashing the application?

@MengRao
Copy link
Owner

MengRao commented Jan 31, 2024

I believe missing a {} would not throw an exception, it just leave the additonal parameters not handled, not a big issue right?

@lsxia
Copy link
Author

lsxia commented Apr 1, 2024

No, I believe the missing {} will cause runtime failure at this moment (which already happened a few times in our system). I agree with you that it would be better than crash if just ignoring the additional parameters.

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