Closed adriankumpf closed 3 years ago
Thanks very much for the PR. My thinking behind logging the "no match" is primarily that if there is a community of users consistently requesting a locale that is not supported then the app team might consider implementing that locale. For that reason I would prefer a configurable log level to that reducing the noise to zero is also an option.
I've published ex_cldr version 2.22.0 with the following changelog entry:
Cldr.Plug.SetSession
was introduced in ex_cldr
version 2.21.0. However the convention in Phoenix and Plug is put
, not set
. The plug is renamed to Cldr.Plug.PutSession
. Cldr.Plug.SetSession
is still available but will emit a deprecation notice and will delegatge to Cldr.Plug.PutSession.
Apologies to all for the sloppy release review process.Cldr.Plug.AcceptLanguage
configurable.* `:cldr_backend` is any backend module. The default
is `Cldr.default_backend/0`. If no `:cldr_backend`
option is provided and no default backend is configured
then an exception will be raised.
* `:no_match_log_level` determines the logging level for
the case when no matching locale is configured to meet the users
request. The default is `:warn`. If set to `nil` then no logging
is performed.
Thanks!
This MR …
Cldr.AcceptLanguage.best_match/2
Cldr.Plug.SetSession
Cldr.Plug.AcceptLanguage
to not log a warning if no matching locale was foundIf the latter is not desired, I would suggest making the log level configurable so that the user of this library can decide whether errors are logged.