mostly functional log generation