fix linux/darwin color logging
use a buffer in windows logging, reduce system calls