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
We have extensive logic in some places in the SmartRedis library for creating message strings. It would be good to refactor this logic in some way to skip creation of the strings when they won't be used, such as when the logging level is not detailed enough to emit them.
message = "Retrieved value \"";
message += cfg_val == NULL ? "<NULL>" : cfg_val;
message += "\"";
if ((NULL == cfg_val) && !no_default)
message += ". Using default value of " + std::to_string(default_value);
log_data("SmartRedis Library", LLDebug, message);
Justification
There is a risk of performance and memory overhead with the way that these strings are created today.
Implementation Strategy
One strategy might be to have an override of std::string that accepts a log level and skips added data unless the log level is fine enough
The text was updated successfully, but these errors were encountered:
Description
We have extensive logic in some places in the SmartRedis library for creating message strings. It would be good to refactor this logic in some way to skip creation of the strings when they won't be used, such as when the logging level is not detailed enough to emit them.
Justification
There is a risk of performance and memory overhead with the way that these strings are created today.
Implementation Strategy
One strategy might be to have an override of std::string that accepts a log level and skips added data unless the log level is fine enough
The text was updated successfully, but these errors were encountered: