Adding logdir function