Skip to content

Issue logging hex - preceding the colon with '0' and logging two uint64_t values prints the first value twice. #3455

@gimrWay

Description

@gimrWay

Issue logging values in hex where preceding the colon with '0' and logging two uint64_t values prints the first value twice.
Problematic code:

SPDLOG_INFO("Hello world: 0x{0:X} 0x{0:X}", val_a, val_b);

I preceded the colon with '0' by mistake, and I quickly realised that it works as expected if you format it without:

SPDLOG_INFO("Hello world: 0x{:X} 0x{:X}", val_a, val_b);

But it seems odd to me that preceding the colon with '0' does not throw an error and yet produces this result. Other values are rejected. Is this expected behaviour? What does preceding the colon do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions