chewbranca commented on code in PR #4483:
URL: https://github.com/apache/couchdb/pull/4483#discussion_r1175823151
##########
src/couch_log/src/couch_log_formatter.erl:
##########
@@ -31,6 +33,30 @@
-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
+ "" -> "";
+ Msg0 -> ["[", Msg0, "]"]
+ end,
+ case iolist_size(Msg) > MaxMsgSize of
+ true ->
+ {error, emsgtoolong};
Review Comment:
I left out an extra identifier like the `ReportId` as that value is provided
by the caller into this function, so the caller that would receive `{error,
emsgtoolong}` just provided the relevant `ReportId` and we're only incrementing
a counter for any report error
https://github.com/apache/couchdb/pull/4483/files#diff-d29be5c448a221047cbe9116da9f07ac471fd11716b561ab1f3979ac5683ce86R62-R65
I'm not necessarily opposed to the idea, I had similar thoughts, but I
didn't see the value of adding it.
--
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]