Skip to content

Using logger.info() with format string #98

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

Closed
cushon opened this issue Oct 31, 2014 · 2 comments
Closed

Using logger.info() with format string #98

cushon opened this issue Oct 31, 2014 · 2 comments

Comments

@cushon
Copy link
Collaborator

cushon commented Oct 31, 2014

Original issue created by tanaeem@google.com on 2013-02-27 at 10:53 PM


A common logging bug is to log like following
logger.info("Number of errors %d", errorCount);

Sadly this does not show any error, except log file is full of nonsense message.

Obviously they were trying to use

logger.infofmt("Number of errors %d", errorCount);

@cushon
Copy link
Collaborator Author

cushon commented Oct 31, 2014

Original comment posted by eaftan@google.com on 2013-03-05 at 04:54 AM


Do you know offhand if there are other logging methods that get misused like this? Why does the logging method take the parameter if it's not going to use it?


Status: Accepted
Labels: -Priority-Medium, Priority-High

@cushon
Copy link
Collaborator Author

cushon commented Oct 31, 2014

Original comment posted by eaftan@google.com on 2013-03-05 at 04:57 AM


Let's continue this discussion on the internal bug here:
http://b/8299370


Status: Duplicate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant