Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error.log should be created in $XDG_CACHE_HOME #110

Open
lahwaacz opened this issue Jan 21, 2016 · 5 comments
Open

error.log should be created in $XDG_CACHE_HOME #110

lahwaacz opened this issue Jan 21, 2016 · 5 comments

Comments

@lahwaacz
Copy link

Even when $XDG_CONFIG_HOME/ncmpcpp/ exists, $HOME/.ncmpcpp/ is still created due to $HOME/.ncmpcpp/error.log, which should be created probably in $XDG_CACHE_HOME/ncmpcpp/ (which is intended for non-essential data).

@AladW
Copy link

AladW commented May 26, 2016

Any progress on this?

@arybczak
Copy link
Collaborator

You need to set ncmpcpp_directory in your config file to $XDG_CONFIG_HOME/ncmpcpp, then it'll be created in $XDG_CONFIG_HOME (which is probably not ideal as you want $XDG_CACHE_HOME, but at least that's something).

@ayekat
Copy link

ayekat commented May 26, 2017

I'm currently working on reopening that pull request, but I've got a question about the awfully unclear specification: XDG_CACHE_HOME is for "non-essential data", but does this include log files?

For comparison, the Linux filesystem hierarchy standard puts cached data in /var/cache and the log files in /var/log. The two are strictly different in that the cache contains data that can be deleted without any issues, since the application provides mechanisms for regenerating it somehow (it's merely there for optimisation); whereas the logs are write-only data that will not be reused by the application itself (and they cannot be regenerated in case of deletion).

I personally set and use $XDG_LOG_HOME, but that is not part of the standard.

@lahwaacz
Copy link
Author

I'd argue that the currently relevant content of error.log can be regenerated as you restart the program and the past errors are in fact non-essential.

@ilkecan
Copy link

ilkecan commented Apr 7, 2022

The specification has been updated to include a new variable named XDG_STATE_HOME, which should be used for log files. From https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html:

The $XDG_STATE_HOME contains state data that should persist between (application) restarts, but that is not important or portable enough to the user that it should be stored in $XDG_DATA_HOME. It may contain:

actions history (logs, history, recently used files, …)

current state of the application that can be reused on a restart (view, layout, open files, undo history, …)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants