Fix #log_debug line number display issue

Move some code around