logging and legend