-
Notifications
You must be signed in to change notification settings - Fork 2.3k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
[Discussion] Enabling bash-it components to communicate messages to users #1501
Comments
Good points! Here's the thing about failing silently. This was mostly based on the fact that error messages printed during Bash-it initialization were causing issues with things like If we can ensure that Bash-it is not initialized on non-interactive shell sessions (like If we can rule out that messages are printed in undesirable situations, we could add a couple of sensible messages. We certainly don't want to flood the user with dozens of messages, but a note that something is wrong might be OK. Personally, I like the way things like Homebrew handle this. There's a This of course would mean that we introduce a logging system in Bash-it. When a plugin is enabled, but the required command is not installed, the plugin would need to log a message for that, which would be shown when you run The So the following main blocks of work:
Thoughts? |
+1 for |
FYI the fix for non-interactive |
@cornfeedhobo, @davidpfarrell, @rico-chet, @jpmcb - please see the implementation of the Since there are no log statements so far, the command does not print anything at the moment. As a start, I thought that we might want to add some output to the Other thoughts about places where logging makes sense? |
@nwinkler Thanks for the update - #1623 does look like a good start. Some immediate thoughts: Log Context
I'm thinking that the core bash-it code maintain a I see it as an array of strings, ie Aborted PluginsI think one of the first areas to add logging would be to plugins, adding error messages when plugins abort without activating (due to missing commands, folders, etc). Logging in _command_existsI think adding logging here is probably a good idea, especially in the short term where little/no other logging will exist.
Wondering if That's all for now - Looking forward to seeing how this progresses ! -DF cc: @NoahGorny |
@davidpfarrell Thanks for the summary - that looks good to me!
|
If adding logging to |
Since the logging has been added to A more advanced version with a callstack has been discussed above and in #1628, but was not implemented at the time. If someone wants to build a more advanced version, that would be cool. |
This issue is very stale, so I close it |
I'd like to reopen this. An easy first step would be to just change the default from "fail silently" to "report errors and warnings" (set |
I am reopening- to leave this as a follow-up mission to enhance our logging information. |
My mental model of logging levels (some of which Bash It doesn't have):
I strongly feel that Bash It should run without errors unless something is broken. (There's still a lot of work to do before we can make this claim, but it's a reasonable near-term goal!) If something is broken, Bash It should complain (loudly, IMO)! Warnings I think should alsö be reported to the user, but again I alsö think that Bash It should run without warnings. This may be more of a medium-term goal. Notice seems like what commands should use to tell the user things, like in I'm working towards normal operation without errors or warnings, so hopefully that will come soon. 😃 |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
[Adapted from recent Gitter posts]
Q: Seeing how bash-it appears to have a
fail silently
mantra to prevent unwanted terminal output, is there a means for bash-it to communicate issues/messages to the user?At first I was thinking something simple like
bash-it logs
and give components a means for creating log messages to communicate error conditions (ie. functions likelog_error
,log_warning
, etc)But then I thought, in addition to that, maybe something like
bash-it messages
which would contain messages that components generated specifically for the user to see (where as logs could contain many types of messaging, auto-generated statuses, etc) ... (ie.user_message
function)THEN we could also design a prompt segment for letting the user know when messages are waiting to be read.
Also, feels like we could give ourselves permission to message the user when initiating a
login
session. Even if it was just to say something like"You have bash-it messages waiting to be read. Use 'bash-it messages' to read them."
The text was updated successfully, but these errors were encountered: