lyuts / vim-rtags

Vim bindings for rtags, llvm/clang based c++ code indexer.
BSD 2-Clause "Simplified" License
282 stars 56 forks source link

Logfile is common for all users, and blocks if root is first user #127

Open paul-jewell opened 3 years ago

paul-jewell commented 3 years ago

I use vim to edit system files etc, under root and also for user specific settings under a user account. If root is the first user of vim since booting, the log file (vim-rtags-python.log) is created with ownership root:root with permissions 644, so subsequent use as the user account creates an error Error detected while processing function rtags#InitPython: line 7: Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/paul/.vim/plugged/vim-rtags/plugin/vimrtags.py", line 11, in <module> logging.basicConfig(filename='%s/vim-rtags-python.log' % tempdir,level=logging.DEBUG) File "/usr/lib/python3.7/logging/__init__.py", line 1898, in basicConfig h = FileHandler(filename, mode) File "/usr/lib/python3.7/logging/__init__.py", line 1087, in __init__ StreamHandler.__init__(self, self._open()) File "/usr/lib/python3.7/logging/__init__.py", line 1116, in _open return open(self.baseFilename, self.mode, encoding=self.encoding) PermissionError: [Errno 13] Permission denied: '/tmp/vim-rtags-python.log' Press ENTER or type command to continue Possible solutions:

mckellyln commented 3 years ago

Hi, I changed it this to my fork:

        silent call system(g:rtagsRdmCmd." --tempdir /tmp/rdm-".$USER." --log-file /tmp/rdm-".$USER.".log --daemon")

in additon to some other updates I've found helpful, if you wanted to try it at: https://github.com/mckellygit/vim-rtags thx, -m