I minimise the impact of unexpected context switches by keeping a running log what I am doing or should do next in a document for each project. It might seem like a waste of time but I can safely mentally let the whole current context go when I am interrupted for an urgent job and I don't have to keep a stack of contexts in my head at once. It is especially useful in getting back up to speed in a context that had to be ignored for a week or more.
Engineering logbooks are a great idea (and electronic/mechanical engineers have been doing it for a while - because it works!).
I use a spiralbound notebook and a fountain pen for mine, because I find the change of tools helps me to think about the project I'm logging on a meta level. I tried doing it in a textfile and it didn't work so well for me, but people are different.
I've been doing this for the last few months and it really helps. In my case it's a set of OneNote grouped tabs for each story/project/etc that I'm working on. I have tabs for re-creating, background, ways to setup the environment for the task at hand, links to things that are helpful, etc.