In this paper, we present a control strategy for unmanned aerial vehicles (UAVs) used for live power line maintenance with a focus on real-time safety and effective navigation in the presence of static obstacles. The proposed method combines Control Barrier Functions (CBF) for handling the task of avoiding obstacles with Control Potential Field Functions (CPFF) that steer the UAVs towards the targeted missions, such that the UAVs can execute goal-oriented and safe behavior during the process. To represent and ensure both task-specific and safety requirements in a formal manner, we deploy Linear Temporal Logic (LTL) so that high-level control goals can be described with precise accuracy. We also include an infeasibility detection mechanism so the control system can react effectively when simultaneous goals of both safety and mission are not satisfiable based on the analysis of the workspace. The functionality of the framework is evaluated via simulations, and the UAV navigates with obstacle-free trajectories and successfully completes power line inspection tasks. The presented strategy offers a scalable and efficient method for the deployment of UAVs in critical infrastructure maintenance.