Common functionality related to logging