emit error if logger isn't an object