You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've run into a scenario where I would like to have the ability to use a runtime string as the log message (i18n pluralization). I can work around the compile-time requirement, but the code doesn't look nice anymore. The log file only supports English, but having correct grammar and pluralization rules would still be nice.
eg: 1 files (wrong grammar) vs 2 files
It's only a minor annoyance. Feel free to close this, if it is out of scope for this project.
The text was updated successfully, but these errors were encountered:
How did I not think about using a format string? 😁 I currently use an if-else block where I check the count variable and do a separate logger invocation in each block, but using a format string is a neat idea too. If I ever decide to translate the log file of my application, this works:
I've run into a scenario where I would like to have the ability to use a runtime string as the log message (i18n pluralization). I can work around the compile-time requirement, but the code doesn't look nice anymore. The log file only supports English, but having correct grammar and pluralization rules would still be nice.
eg:
1 files
(wrong grammar) vs2 files
It's only a minor annoyance. Feel free to close this, if it is out of scope for this project.
The text was updated successfully, but these errors were encountered: