logging logic amended