Skip to content

Commit 77477de

Browse files
committed
Run rabbit_ct_hook before cth_styledout, so that default logger handler properly removed
As a follow-up to my GChat thread about removing default logger handler to clean CT stdout, I was looking at injecting logger config with undefined default handler to ct_run. It is possible but breaks cth_styledout - no nice green things whatsoever. Then I found rabbit_ct_hook which calls redirect_logger_to_ct_logs which in turn calls logger:remove_handler(default) apparently with zero effect! To cut story short - turned out rabbit_ct_hook must run before cth_styledout for remove_handler line to have any effect
1 parent b527fc3 commit 77477de

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

deps/rabbit/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ MANPAGES = $(wildcard $(DOCS_DIR)/*.[0-9])
151151
WEB_MANPAGES = $(patsubst %,%.html,$(MANPAGES))
152152
MD_MANPAGES = $(patsubst %,%.md,$(MANPAGES))
153153

154+
CT_HOOKS = rabbit_ct_hook
154155
DEP_EARLY_PLUGINS = rabbit_common/mk/rabbitmq-early-plugin.mk
155156
DEP_PLUGINS = rabbit_common/mk/rabbitmq-plugin.mk
156157

@@ -221,8 +222,6 @@ ct-fast:
221222
ct-slow:
222223
$(MAKE) ct CT_SUITES='$(SLOW_CT_SUITES)'
223224

224-
CT_OPTS += -ct_hooks rabbit_ct_hook []
225-
226225
# Parallel CT.
227226
#
228227
# @todo We must ensure that the CT_OPTS also apply to ct-master

deps/rabbit_common/mk/rabbitmq-early-plugin.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ CT_OPTS += -kernel net_ticktime 5
3838
# This hook will change the output of common_test to something more
3939
# concise and colored.
4040

41-
CT_HOOKS ?= cth_styledout
41+
CT_HOOKS += cth_styledout
4242
TEST_DEPS += cth_styledout
4343

4444
ifdef CONCOURSE

0 commit comments

Comments
 (0)