From ea8756f85ddd0aeed2e7eccd0ea86ade4fb7eca8 Mon Sep 17 00:00:00 2001 From: Michael Lingelbach Date: Wed, 13 Jan 2021 14:20:21 -0800 Subject: logging: move to XDG_CACHE_HOME (#13739) while there is some controversy, stdpath('cache') looks like a better fit for logs than stdpath('data'): you can remove logs without preventing nvim to work which fits the XDG_CACHE_HOME definition of `user specific non-essential data files`. --- src/nvim/os/stdpaths.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/nvim/os') diff --git a/src/nvim/os/stdpaths.c b/src/nvim/os/stdpaths.c index 66bc990402..93b8d5ca12 100644 --- a/src/nvim/os/stdpaths.c +++ b/src/nvim/os/stdpaths.c @@ -108,6 +108,17 @@ char *get_xdg_home(const XDGVarType idx) return dir; } +/// Return subpath of $XDG_CACHE_HOME +/// +/// @param[in] fname New component of the path. +/// +/// @return [allocated] `$XDG_CACHE_HOME/nvim/{fname}` +char *stdpaths_user_cache_subpath(const char *fname) + FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_RET +{ + return concat_fnames_realloc(get_xdg_home(kXDGCacheHome), fname, true); +} + /// Return subpath of $XDG_CONFIG_HOME /// /// @param[in] fname New component of the path. -- cgit