jrnl icon indicating copy to clipboard operation
jrnl copied to clipboard

Supress output if action is successful

Open kwbr opened this issue 2 years ago • 2 comments

Feature Request

Provide an option to silence the output if operation is successful.

Use Case/Motivation

If everything has worked there is no need to print a 3 line graphical box that everything was written to my journal successfully. This is exactly what I would assume. I see this box 30 times a day and it does not provide useful information.

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓                                                                                                        
┃  Entry added to default journal  ┃                                  
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ 

Other information

Please provide either an option or a configuration switch to suppress that output.

kwbr avatar Jul 22 '22 08:07 kwbr

Hi! Thanks for filing this issue. In the code, we recently added a way to easily handle different styles of output. This is where the boxes came from, but it can easily support other styles. So, we went with the graphical boxes as the default, but were considering adding a way to change the output that a user sees (probably in the config, but maybe some flag).

Would having a different style of output (like a more compact, 1-line format) address your concerns? Or would it still be more useful to have some way to have zero output on successful operations?

wren avatar Jul 30 '22 18:07 wren

I would prefer no output for successful operations. This is known as the "Rule of Silence" (http://www.linfo.org/rule_of_silence.html).

kwbr avatar Aug 02 '22 11:08 kwbr

Thanks for the link, @kwbr. I like this notion. Just a few things we need to sort out:

What should be suppressed. This "Rule of Silence" piece presents a strong argument for suppressing this message for new entries. But what about edited entries? Especially when a timestamp is removed by the user, it can be a lot less clear as to what has happened to an entry. Maybe we would still want a list of entries added, deleted, and removed in that case. And also, are there any other messages that should perhaps be silenced by this?

How to set the verbosity level. Approaches:

  • Command-line argument like --verbose to see these messages
  • Config argument such as verbose, perhaps settable to "default" or "verbose"
  • Both of the above

What the default behavior should be. Rather than changing the default, it could be set to the current behavior, and instead of setting --verbose in the args and/or verbose in the config file, there could be a quiet argument/setting instead.

How this interacts with the current --debug flag. I don't see any major issues with this off the top of my head but wanted to raise the issue in case anyone has any thoughts about it.

Lastly, just to keep the links together: there's currently an open PR directly affected by these decisions #1524 and its functionality should reflect whatever we decide here.

micahellison avatar Aug 13 '22 20:08 micahellison

The proposal sounds good to me. Setting the verbosity level in a backwards compatible way makes sense. A user, like me, that prefers no output could easily opt-in.

One thought: maybe let's start with the obvious things to suppress output. The example you brought up about complex edits and what to show the user in this case could be solved in a separate issue.

kwbr avatar Aug 15 '22 05:08 kwbr

One thought: maybe let's start with the obvious things to suppress output. The example you brought up about complex edits and what to show the user in this case could be solved in a separate issue.

Thanks for this thought. That's a great point and I'm happy to move forward with this change rather than holding it up with all these other questions.

I put in a PR to suppress the message with one exception: it still displays the message if you're journaling to a non-default journal. I think that message is still useful in those cases, especially considering how "magic" jrnl is when it comes to identifying journals in what would otherwise look like journal entry content.

micahellison avatar Aug 21 '22 22:08 micahellison