using a logger instead of global logger