Is it/could it be possible to prevent some macros from logging to the engine log?

I have macros that fire on applications activating, de-activating, window focus changes, etc etc. This results in a lot of spam in the engine log and makes it difficult to fish out the important stuff when debugging something. Thanks.

1 Like

Hey @devoy,

I reckon that's way more trouble than it's worth for @peternlewis.

You might take a look at these:

Open the Keyboard Maestro Engine Log in the Console or BBEdit

Display Last KM Macro Error

-Chris

It is important that every macro triggered is reported in the log. It is perhaps the most important purpose of the log.

So it's unlikely I would provide a way to disable that.

I suggest instead to do something like:

tail -f Engine.log | grep -v "My Frequent Macro"

I have something like below.

It gets the last 20 lines of the Engine Log (you can change the number).
I put everything I don't want to show in capture groups separated by the | [OR] operator in the RegEx action. It will filter all these unwanted lines. It will then display the rest of the lines.

MACRO:   03)KM - Get Recent Logs for KM Engine and Editor

DOWNLOAD Macro File:

03)KM - Get Recent Logs for KM Engine and Editor.kmmacros
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.


1 Like

Thank you both!

@peternlewis your solution is 98% perfect. The last bit missing is due to my use case..I generally try to keep this running in a BBEdit shell worksheet. But the piped grep seems to break the "tail -F". It works in a terminal window though, which is good enough.

@martin My challenge with your also-very-good solution is being sure that I have caught enough lines to find what I want..and your macro includes the spam in a fixed number of lines before filtering it out. But I certainly appreciate you sharing because it's not an approach that I'd considered..I know I will find a use for it at well!

Again, thanks both.