Skip to content

Wrong print statement in Debug function #619

Description

@thomas-lentz

Hi,
I'm having an issue with the print statement in the ping keep alive function:

func makePingKeepAlive(db *gorm.DB, host string, typeData string, node string) {
	for {

		pingErr := db.DB().Ping()
		if pingErr != nil {
			logger.Error(fmt.Sprintf("couldn't make ping to [Host: %s], Type: [%s], Node: [%s]  Error: [%v]",
				host, typeData, node, pingErr))
		} else {
			logger.Debug(fmt.Printf("Successful ping: %s, Type: %s, Node: %s", host, typeData, node))
		}

		time.Sleep(time.Duration(60) * time.Second)
	}
}

Shouldn't it be "Sprintf" instead of "Printf" in the logger.debug statement in the else path (analog to the logger.Error statement)?

homer-app/main.go

Line 2096 in b30c6e3

logger.Debug(fmt.Printf("Successful ping: %s, Type: %s, Node: %s", host, typeData, node))

Greetings
Tom

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions