One possibility could be to use ControllerMate.
You would have to create a Driver Configuration and map all of the keys to None. Then there are multiple ways to enable/disable the custom Driver Configuration, but unfortunately CLI is currently not an option.
But CM is very customizable and I'm sure you could come up with something. For example, using the logic blocks, you could have it disable when you have held down Z for 2 seconds, then hold down P and click the mouse. Using a delay timer block to wait for 30 seconds but then only re-enable if holding the left shift key down and scrolling the mouse up/down.
Another similar utility that might work is Karabiner-Elements. It is a complete rewrite of his wonderful Karabiner app which broke hard with macOS Sierra. It is still in the early development stages but it might have the functionality you need.
Okay, I think the issue is resolved.
The culprit turned out to be an old piece of software from 2011 - Tags, for Mail (http://www.caseapps.com/tags/).
It installed an mdimporter into /Library/Spotlight/.
After reading up on the new logging system and figuring out how to disable obfuscation in order to not get those <private>
entries in the logs since those don't help me see which files are being accessed by the md processes,
I ran log stream --style compact --predicate '(process contains[c] "mdworker") && (subsystem ==[c] "com.apple.spotlightserver")' --info --debug
and watched it.
It kept hanging up in a particular directory, in ~/Mail/V6. I went looking through the directory tree looking for permissions/uid issues -- nothing.
I re-ran the command with tee
, so that I could tail
it and grep
out interesting parts to investigate.
Then I noticed that it seemed like _TagsMail.mdimporter
was being mentioned in each line where mdworker
was being called to import an email.
An excerpt:
2019-05-08 21:36:07.002 Db mdworker[53808:1463e7e] [com.apple.spotlightserver:Server] sandbox profile activated time:0.01667 uid:501 profile:mdworker cache:/var/folders/xb/25w333f48xl1ns0059bd0kxh0000gn/C/ temp:/var/folders/xb/25w333f48xl1ns0059bd0kxh0000gn/T/ home:/Users/B**** lib:/Users/B****/Library M:(null) MV2:(null) typeExtension:0 bundleId:com.gravityapps.TagsMail
I looked up tagsmail.mdimporter
and the first web page hit is "_TagsMail.mdimporter prevents Spotlight in Mojave to finish": http://www.mnott.de/_tagsmail-mdimporter-prevents-spotlight-in-mojave-to-finish/
Interesting. I moved the mdimporter plugin out and immediately saw progress being made, rather than the same roughly 10x files being attempted to index continually.
Rebooted the machine, created a test file on the desktop, searched for it and saw it pop up almost immediately. Good sign that the indexer is working properly.
Best Answer
No support for
--start
The usage guidances for
log stream usagelog stream
give no indications that a--start
argument is supported, I wonder if they were talking aboutlog show
instead.Using
log show
log show
has a--start
switch which you can use as follows:NOTE: This can be a very expensive command to run since it'll be going through all the logs on your system from that
--start
time, but will return all the matches to youregrep
.Streaming logs
The use of
log show
will stop once it encounters the end of the logs. If you truly want to analyze/filter the stream of logs as they occur then you'll want to uselog stream
like this:-or-
References