Whenever I'm trying to record a video from a game, using x264vfw codec, I get this log message, which makes my game minimize and which inevitably makes my tool record black screen, for a few seconds until I resume the game.How can I get rid of it?

On
If you're on Windows 10 (which was my case), a solution that does exactly what the other answer does (but automatically, without editing the registry) is to run Configure x264vfw and Configure x264vfw64 from the x264vfw installation package as administrator and set the Log Level to None while checking the Zero Latency option. This creates the required registry keys and also eliminates the log window.
Roman R.'s solution is preferable if you want to achieve this programatically (like it seems from your screenshot). My answer is just an alternative for people that are not interested in doing this at runtime.
See posts under "Discussion" there: