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

September is the only month abbreviated with four letters #3194

Closed
eronconi opened this issue Sep 18, 2024 · 3 comments
Closed

September is the only month abbreviated with four letters #3194

eronconi opened this issue Sep 18, 2024 · 3 comments

Comments

@eronconi
Copy link

Hello all,

I've noticed that month abbreviations hardcoded in include/spdlog/pattern_formatter-inl.h use three letters for all months except September, which is abbreviated with Sept.

This makes logs misaligned when the month changes to/from September, and makes logs misaligned to other logs created with *nix tools/sprintf which uses three letter abbreviations for all months.

Is there a particular reason for this? Thanks!

@tt4g
Copy link
Contributor

tt4g commented Sep 18, 2024

The %b flag is defined only as “Abbreviated month name” and there is no requirement for three characters, so both Sep and Sept are correct.

https://github.com/gabime/spdlog/wiki/3.-Custom-formatting#pattern-flags

| %b | Abbreviated month name | "Aug" |

Use the %3!b flag if you want to align to 3 letters: https://github.com/gabime/spdlog/wiki/3.-Custom-formatting#aligning

@eronconi
Copy link
Author

Thanks for the suggestion, I didn't thought to use alignment feature to truncate the name. It works great.

However, while there are no requirements on "Abbreviated month name", I still find quite odd to have that exception.

@gabime
Copy link
Owner

gabime commented Sep 18, 2024

@eronconi eronconi closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2024
gabime added a commit that referenced this issue Nov 25, 2024
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

3 participants