-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cth_log_redirect could support more logger configuration #8062
Comments
I think this sounds like good idea and matches to other initiatives aiming at taming CT output. |
I'd propose replacing the above snippet with the following change: HandlerConfig =
case logger:get_handler_config(default) of
{ok, Default} ->
maps:with([level, formatter, filters, filter_default], Default);
_Else ->
#{
level => info,
formatter => {?DEFAULT_FORMATTER, ?DEFAULT_FORMAT_CONFIG}
}
end, |
Please create a PR. I guess you intended to use |
👍 Yes, you are correct (I've updated the suggestion snippet) |
Short status update: got stuck with the tests. I haven't figured out how they work exactly and how to add a new test for this case yet. |
CT tests are sometimes tricky. Can you push PR without tests at this stage? |
Is your feature request related to a problem? Please describe.
When using
cth_log_redirect
progress logs get enabled automatically (because of howlogger
works by default). In some cases, these can get very verbose and increase the size of test logs by megabytes.The actual case is starting
hackney
with{ssl_options, tls_certificate_check:options(Host)}
which will include all system certificates as binaries in the start arguments. This results in logging megabytes of binary data to the log every time Hackney starts.Describe the solution you'd like
The module
cth_log_redirect
should copy additionallogger
configuration such asfilters
andfilter_default
so that one can use e.g.logger_filters:progress/2
as a filter for the test logs.Describe alternatives you've considered
Completely replace our HTTP client implementation just to avoid blowing up the size of the test logs.
Additional context
Would most likely require minimal changes here:
otp/lib/common_test/src/cth_log_redirect.erl
Lines 134 to 141 in e6cc808
Would be happy to do a PR if there is agreement that this change is desirable.
The text was updated successfully, but these errors were encountered: