GChristensen / enso-portable

Portable Enso Launcher community edition
Other
167 stars 46 forks source link

Is it possible to log messages? #35

Closed gilch closed 4 months ago

gilch commented 4 months ago

It's easy to accidentally dismiss one of Enso's transparent message displays before reading it.

Enso was designed around Jef Raskin's UI philosophy (Aza Raskin is his son). Raskin thought that OK-button dialogs are stupid UI design. They interrupt your flow and tend to be instantly dismissed out of habit, even when they say something important. Buttonless messages like Enso has were his solution, but that's not all of it. For example, one common use for OK dialogs is to prevent you from accidentally closing your editor without saving (but if you're in the habit of instantly dismissing dialogs without reading them, this tends to happen anyway). Buttonless messages wouldn't help here, but autosaving would. In general, the user should be able to quickly undo the effects of any mistakes in input. Another important point was that messages should be logged somewhere in case you accidentally dismiss one before you can finish reading it.

If set_selection() display_message() were Python code imported normally, I could just monkeypatch it with advice on startup, but where it's passed in through an argument, I'm not sure how it works or where to find it. I'm sure I could hack a solution in eventually for my own use, but this seems like a feature Enso ought to have.

GChristensen commented 4 months ago

Thanks, I'm familiar with Raskin's philosophy. If you read the tutorial carefully, you may find that you can import anything to your command files and even keep modules or libraries in your enso home folder. You can, for example import and configure logger of the standard python logging library that would log anything to a file of your choice. Enso has a builtin logger configured (e.g. logging.info(...), so this feature is already presents. Some more could be figured out from the scripts/run_enso.py.

gilch commented 4 months ago

Oops, I meant to log display_message(), not set_selection. That was confusing.

gilch commented 4 months ago

To be clear, I'm talking about logging all the popup messages Enso displays to the user, not just adding logging to my own custom commands.

GChristensen commented 4 months ago

I believe that the KISS principle should be observed when possible. The ability to log anything from your commands should be enough.