first variant of logWriter