Skip to content

Using logger.info() with format string #98

Closed
@cushon

Description

@cushon
Collaborator

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);

Activity

cushon

cushon commented on Oct 31, 2014

@cushon
CollaboratorAuthor

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

cushon commented on Oct 31, 2014

@cushon
CollaboratorAuthor

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @cushon

        Issue actions

          Using logger.info() with format string · Issue #98 · google/error-prone