Replace Log class with a generator