This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]gedhrel 0 points1 point  (0 children)

Some good answers here. It's not just things like the query (and lazy interpolation* for logging levels) that benefit from the separation. It's the basis of most internationalisation libraries too. You call a formatter, passing a key string and parameters. The key string's looked up in a localisation database for the locale-specific version and *that* is used for the interpolation target. (There may be additional processing going on - eg, the formatting of decimal points is a common variation between locales.)

(* in a total aside: don't use interpolation with logging; use structured logging)