emilk / loguru

A lightweight C++ logging library
The Unlicense
1.76k stars 256 forks source link

Make the use of locale optional via `LOGURU_USE_LOCALE` #216

Closed kcgen closed 2 years ago

kcgen commented 2 years ago

Application developers can use the established LOGURU_USE_ mechanism to toggle the use of LOCALE:

#define LOGURU_USE_LOCALE 1 (or 0)

.. Or nothing, which will use LOCALE by default.

Application developers may want to avoid calls into the the host's locale system, which can cause problems if the external application is expecting to use a narrow character set but gets a wide character set (and vice-versa).

bylowerik commented 2 years ago

The checks seem to fail.

kcgen commented 2 years ago

Thanks @bylowerik ; indeed, it seems VS 2014 wasn't able to up-cast the char to the int, which is the first argument to the non-locale version of std::isalpha. I've added an explicit static cast, which appears to have satisfied it.