-
Notifications
You must be signed in to change notification settings - Fork 519
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
rebar3 shell: implement various modes to print "booted" message #2513
Conversation
src/rebar_prv_shell.erl
Outdated
_ = [?INFO("Booted ~p", [App]) | ||
|| {ok, Booted} <- Res, | ||
App <- Booted], | ||
print_booted([App || {ok, Booted} <- Res, App <- Booted], BootMessageMode), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the thing we got with the current implementation is help when apps may get stuck or stalled in case of issues getting started. Otherwise if you have 12 apps to load and the 9th gets stuck, you never have any idea what is going on.
This is unfortunately not super compatible with the short format if there's stuff being printed during app boots however.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is undocumented application:info
to see what is the current state, and why not all applications are booting correctly.
Is silent / quiet / short / verbose the best way around this compared to the usual log levels we have? Or should the flag turn the boot message from info to debug? I don't feel strongly either way, but it feels like we're introducing various verbosity controls that could map reasonably well to existing controls. The short vs. verbose mode wouldn't fit that though. |
To give some context about the issue I'm trying to solve: On one side, I like the idea of using log level to control this output (e.g. print "===> Booted" messages in debug verbosity). On the other, it'd be great to provide at least some feedback on the boot process. But in a way that does not disrupt shell interactions. Maybe there is a way to somehow control TTY output and, for example, instead of logging apps that booted, display the name of the app that is being booted? I don't know whether it's possible to achieve this easily. |
Another thought here, I wonder if it's possible to use TTY magic to print these "Booted" messages elsewhere, e.g. in the prompt. |
there are ways around that, though they wouldn't work with the old shell and might require manually sending instructions to unprint or scroll the terminal around. The real cool stuff sort of relies on curses-like APIs that are not very portable for escripts. |
Then probably the smallest change is |
yeah that's likely the simplest basic one to run, I'd be fine with that. DEBUG output is getting more usable anyway and this is the kind of stuff that could make sense to push there. |
This commit adds a parameter to `rebar.config` shell section: {shell, [ {apps, [megaco, tools, runtime_tools]}, {log, info | debug} ]}. With 'info' (default), behaviour stays as before. With 'debug', "===> Booted megaco" messages are printed with debug verbosity level, and are available when rebar3 is run with DEBUG=1 environment variable.
0a8f34a
to
eb086dd
Compare
This commit adds a parameter to
rebar.config
shell section:This commit adds a parameter to
rebar.config
shell section: