Support for logger.tagged. Code borrowed from active_support.