[Bug]: kLogMessageBufferSize is not user-configurable
Describe the issue
kLogMessageBufferSize is set to an arbitrary value that may not work for all use cases
Steps to reproduce the problem
Log something longer than kLogMessageBufferSize with LOG(...) << ...
What version of Abseil are you using?
HEAD
What operating system and version are you using?
Doesn't matter (Windows)
What compiler and version are you using?
Doesn't matter (MSVC)
What build system are you using?
Doesn't matter (CMake)
Additional context
No response
Can you please say more about the use case and motivation for this request? What do you think you would want to set this to if it was configurable? Would it be satisfactory if we instead offered a macro variant that breaks up longer operands and logs them as multiple pieces (at a higher runtime cost)? Why are the debug logs the right place for these large (>15kB) data, as opposed to (say) separate files or a lightweight database?
Adding one configuration knob for this would not be hard technically, but we want to be careful to create an overall configuration story for Abseil that is consistent and useful without being too fine-grained. We also want to test and (if appropriate) benchmark the configurations we do offer, which means each new one has an ongoing cost.
Can you please say more about the use case and motivation for this request? What do you think you would want to set this to if it was configurable?
Just ran into a case where it was 10x easier to log a big thing than to break it up myself. In my case I might have set it to something like 50kB.
Would it be satisfactory if we instead offered a macro variant that breaks up longer operands and logs them as multiple pieces (at a higher runtime cost)?
Absolutely. This would be great.
Would it be satisfactory if we instead offered a macro variant that breaks up longer operands and logs them as multiple pieces (at a higher runtime cost)?
Simplicity, simplicity, simplicity. I needed to spit something out to the debug logs in a pinch to see it, and didn't particularly care that it was egregiously large. Why would I care, really? I know the costs. Much cheaper to barf out 50kB to the debug logs for a few minutes than to engineer a side-channel for the same data.
Adding one configuration knob for this would not be hard technically, but we want to be careful to create an overall configuration story for Abseil that is consistent and useful without being too fine-grained. We also want to test and (if appropriate) benchmark the configurations we do offer, which means each new one has an ongoing cost.
That's all totally fair. Your suggestion about having a breaking-up macro seems great, if it resolves concerns about configuration surface area.
1460