fix import for logging, fix inspired by elliotpeele