I am going to use logging.StreamHandler in Blender console. But, sys.stdout is constantly changing in the memory.
In Windows Console:
In Blender Console:
Because of that, I cannot use logging.StreamHandler. It just does not work, and I do not know why it happens. As a workaround, I can copy-paste logging.StreamHandler and re-implement in the way that it will write messages directly to sys.stdout, without caching to some member 'stream'. But it is a workaround...