From: "\( via Guix-patches" via <guix-patches@gnu.org>
To: "Philip McGrath" <philip@philipmcgrath.com>,
"Andrew Tropin" <andrew@trop.in>,
"Bruno Victal" <mirai@makinata.eu>
Cc: 61982@debbugs.gnu.org
Subject: [bug#61982] [PATCH 2/2] home: services: xdg-base-directories: Deprecate XDG_LOG_HOME.
Date: Sun, 09 Apr 2023 20:57:54 +0100 [thread overview]
Message-ID: <CRSHOENTZGT6.2A5WD1YC8VIRO@guix-framework> (raw)
In-Reply-To: <92d07a8a-aac9-42c7-809d-66373358c77b@app.fastmail.com>
[-- Attachment #1: Type: text/plain, Size: 1736 bytes --]
On Sun Apr 9, 2023 at 8:09 PM BST, Philip McGrath wrote:
> > I meant introducing something like this
> > (define (get-log-dir)
> > (string-append
> > (getenv "XDG_STATE_HOME") "/log"))
> >
>
> Within the XDG directories, I think (unless perhaps you only use a single file) you are supposed to keep everything in a subdirectory named for your application (or with a well-known name for things shared among multiple applications). For example, on my system, I can find log files in "$XDG_DATA_HOME/akonadi/Akonadi.error", "$XDG_DATA_HOME/akonadi/Akonadi.error.old", "$XDG_DATA_HOME/sddm/wayland-session.log", and "$XDG_DATA_HOME/sddm/xorg-session.log". (Apparently SDDM and Akonadi haven't been updated to use $XDG_STATE_HOME.) I think Guix Home services should follow that convention, rather than putting all logs together in "$XDG_STATE_HOME/log/".
So it turns out Shepherd provides these gems squirreled away inside its
(shepherd support) module:
```
(define %user-config-dir
;; Default config directory if shepherd is run as a normal user.
(string-append (or (getenv "XDG_CONFIG_HOME")
(string-append user-homedir "/.config"))
"/shepherd"))
(define %user-log-dir
;; Default log directory if shepherd is run as a normal user.
(string-append (or (getenv "XDG_STATE_HOME")
(string-append user-homedir "/.local/state"))
"/shepherd"))
(define %user-runtime-dir
;; Default runtime directory if shepherd is run as a normal user.
(string-append (or (getenv "XDG_RUNTIME_DIR")
(format #f "/run/user/~s" (getuid)))))
```
Shepherd already provides us with a %USER-LOG-DIR variable :D
-- (
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
next prev parent reply other threads:[~2023-04-09 19:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-05 15:16 [bug#61982] [PATCH 0/2] Respect XDG Base Directory Specification 0.8 Bruno Victal
2023-03-05 15:19 ` [bug#61982] [PATCH 1/2] home: services: xdg-base-directories: Set correct value for XDG_STATE_HOME Bruno Victal
2023-03-05 15:19 ` [bug#61982] [PATCH 2/2] home: services: xdg-base-directories: Deprecate XDG_LOG_HOME Bruno Victal
2023-04-07 8:45 ` Andrew Tropin
2023-04-07 11:47 ` Bruno Victal
2023-04-07 12:46 ` Andrew Tropin
2023-04-09 19:09 ` Philip McGrath
2023-04-09 19:57 ` ( via Guix-patches via [this message]
2023-04-09 20:01 ` ( via Guix-patches via
2023-06-15 9:35 ` bug#61982: " Andrew Tropin
2023-06-15 18:09 ` [bug#61982] " Philip McGrath
2023-06-16 3:28 ` Andrew Tropin
2023-06-17 18:22 ` Philip McGrath
2023-04-07 6:43 ` [bug#61982] [PATCH 1/2] home: services: xdg-base-directories: Set correct value for XDG_STATE_HOME Andrew Tropin
2023-06-09 21:01 ` [bug#61982] [PATCH 0/2] Respect XDG Base Directory Specification 0.8 Ludovic Courtès
2023-06-14 9:27 ` Andrew Tropin
2023-04-11 20:01 ` [bug#61982] [PATCH 2/2] home: services: xdg-base-directories: Deprecate XDG_LOG_HOME ( via Guix-patches via
2023-04-12 17:17 ` Andrew Tropin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CRSHOENTZGT6.2A5WD1YC8VIRO@guix-framework \
--to=guix-patches@gnu.org \
--cc=61982@debbugs.gnu.org \
--cc=andrew@trop.in \
--cc=mirai@makinata.eu \
--cc=paren@disroot.org \
--cc=philip@philipmcgrath.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).