openstenoproject / plover

Open source stenotype engine
http://opensteno.org/plover
GNU General Public License v2.0
2.36k stars 277 forks source link

Add system name to strokes log #1295

Open Willem3141 opened 3 years ago

Willem3141 commented 3 years ago

Is your feature request related to a problem? Please describe.

I regularly switch systems to be able to write in two different languages (English and Dutch). I also like running statistics on my strokes log to see, for example, which are the dictionary entries I use most. However, as the strokes log doesn't contain the current system name, it is not (easily) possible to distinguish in which language any stroke was done.

I do most of my system switches with steno strokes, so they do show up as strokes in the log:

2021-04-14 16:30:20,579 Translation(('*RB',) : "{PLOVER:SWITCH_SYSTEM:English Stenotype}")

But this is not really reliable, because I also sometimes use the settings window to switch.

Describe the solution you'd like

Besides the existing log message types Stroke and Translation, add a new type of log entry (e.g. SystemSwitch) that is written whenever the system was switched.

Describe alternatives you've considered

An alternative could be to add the name of the active system to each Translation entry. This would make the analysis a bit easier, but probably costs more disk space.

user202729 commented 3 years ago

You should be able to write a plugin that listens to config_changed events and write a Plover log message (plover.log.info) accordingly. (it won't go to the strokes.log file however, but you might be able to also listen for on_stroked and log the whole thing)