chewbranca commented on code in PR #4483:
URL: https://github.com/apache/couchdb/pull/4483#discussion_r1175818102


##########
src/couch_log/src/couch_log_formatter.erl:
##########
@@ -31,6 +33,31 @@
 
 -define(DEFAULT_TRUNCATION, 1024).
 
+-define(REPORT_LEVEL, report).
+
+format_report(Pid, Type, Meta) ->
+    MaxMsgSize = couch_log_config:get(max_message_size),
+    Msg = case format_meta(Meta) of
+        "" ->
+            "";
+        MetaStr ->
+            ["[", MetaStr, "]"]
+    end,
+    case length(Msg) > MaxMsgSize of

Review Comment:
   Good catch. I switched to `iolist_size` which will handle empty strings, 
empty lists of strings, and other combinations:
   
   ```
   Eshell V11.2.2.13  (abort with ^G)
   1> iolist_size("").
   0
   2> iolist_size([""]).
   0
   3> iolist_size(["","",""]).
   0
   4> iolist_size(["","foo","", "bar"]).
   6
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to