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
At the moment logging logs double in a lossy way, and we variably use snprintf, MSVC's sprintf_s, << and std::setprecision(std::numeric_limits<long double>::digits10 + 1), or std::setprecision(std::numeric_limits<long double>::max_digits10) when we need reversible lossless conversion to string.
This should be unified, our logs should be lossless as much as possible, and we should be compatible with the way proto does things (which is locale-independent). A simple solution would be to just call the relevant protobuf function (NoLocaleStrtod) for parsing.
For printing we may have different needs, since SimpleDtoa tries to do very smart things, and we care about numbers having a constant width in our logs, which is why we explicitly log the +.
We could overload operator<< for LogStream so that logging uses our unified DebugString. Similarly, we could do that on our OFStream (we should also eliminate direct use of std::ofstream from our codebase).
The text was updated successfully, but these errors were encountered:
At the moment logging logs double in a lossy way, and we variably use
snprintf
, MSVC'ssprintf_s
,<<
andstd::setprecision(std::numeric_limits<long double>::digits10 + 1)
, orstd::setprecision(std::numeric_limits<long double>::max_digits10)
when we need reversible lossless conversion to string.This should be unified, our logs should be lossless as much as possible, and we should be compatible with the way proto does things (which is locale-independent). A simple solution would be to just call the relevant protobuf function (
NoLocaleStrtod
) for parsing.For printing we may have different needs, since
SimpleDtoa
tries to do very smart things, and we care about numbers having a constant width in our logs, which is why we explicitly log the+
.We could overload
operator<<
forLogStream
so that logging uses our unifiedDebugString
. Similarly, we could do that on ourOFStream
(we should also eliminate direct use ofstd::ofstream
from our codebase).The text was updated successfully, but these errors were encountered: