snippet for logging