tail -f [unity 로그 파일]

less than 1 minute read

(defun unity-open-editor-log ()
  (interactive)
  (let ((path (format "C:/Users/%s/AppData/Local/Unity/Editor/Editor.log"
                      (getenv "USERNAME"))))
    (if (file-exists-p path)
        (progn
          (find-file path)
          (auto-revert-tail-mode 1)
          (read-only-mode 1)
          (goto-char (point-max)))
      (message (concat "log file not found - " path)))))

log 파일을 볼 일이 없어야 좋은 건데. unity가 요즘 애먹이고 있다. tail -f 명령을 사용하다가 emacs에 비슷한 게 있나 찾아봤다.

auto-revert-tail-mode를 사용했다. auto-revert-tail-mode는 수정을 딱히 막지 않아서 버퍼를 읽기 전용으로 만들었다. 파일은 find-file 함수로 열면 된다.

C-x C-s C-x C-c