unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Attila Lendvai <attila@lendvai.name>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: "Ludovic Courtès" <ludo@gnu.org>, guix-devel <guix-devel@gnu.org>
Subject: Re: [shepherd] several patches that i deem ready
Date: Wed, 24 Jan 2024 10:56:46 +0000	[thread overview]
Message-ID: <nrHrlp1sx6ty3OocRLevfyy0fEKmWjgSUbJd79Dixpxmu0t3wSj1v8Xa9wE8T-8zjUGm3m-g4Ms6XpC-o6FqzcIUK4ObM5afHdCg07wUnmw=@lendvai.name> (raw)
In-Reply-To: <87a5ow2nje.fsf@gmail.com>

> About "cheaper code path when a log level is disabled at runtime",
> perhaps it can be improved in guile-lib, but otherwise that's a nice
> list. I just wish we had a good logging library in Guile and could stop
> reinventing the wheel left and right.


i've made my judgement that the logger in guile-lib was never applied seriously when i relized that it stores the enabled state in a hashtable (which must be looked up for every log statement).

i made sure the log statements have a unique syntax, so the underlying machinery can be replaced easily later, and then i moved on.


> OK. For levels greater than debug, they I see them as glorified
> comments (executable comments as yo wrote), so I don't see a strong
> reason to attempt to hide them or treat them specially. In Python
> (which strives to be readable), we typically break logging lines (which
> are concatenated for free inside the parens -- default Python behavior),
> and that doesn't hurt readability in my opinion, and means we can just
> follow the usual style rules, keeping things simple.


my experience is different. i found myself only ever looking at log statements when i'm debugging something, regardless of the level, and including other people's code. and then i just toggle line wrap with the press of a button.

must be related to my habit that i usually put more effort into making the code more self-documenting (readable) than i put into writing informal comments and documentation. and rethinking my "executable comment" metaphore: these log statements serve much less as comments than reporting the temporal state and program flow.

but my primary aim is to color it all gray, and i don't immediately know how to do that in emacs for multiline sexp's (i.e. balanced parens). this is the primary reason our team just kept them on one line, but the flexibility of toggling word wrap as needed is also nice: the essetial part is always within a reasonable margin, and the rest can be read when word-wrap is enabled.

if requested, then i'm willing to re-format the log statements if i can find a way to still color it all gray. it's important that logging stays out of sight while reading the code.


> Thanks for working on this, I'm sure it'll help many, myself included,
> following the execution of Shepherd more easily.


my pleasure!

in my experience when a project doesn't have proper logging, backtraces, error handling hygene, and warning-free compilation, then inefficient debugging quickly eats up more time than it would take to implement these features properly.

unfortunately, guix and guile is not very good on this front, so i found myself working on these, too. such investment rarely pays off for the first bug, but it pays off very well in the long run.

-- 
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“A political situation is the manifestation of a parallel psychological problem in millions of individuals. This problem is largely unconscious (which makes it a particularly dangerous one!)”
	— Carl Jung (1875–1961), Letters, vol.1 pg. 535



  reply	other threads:[~2024-01-24 10:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 23:38 [shepherd] several patches that i deem ready Attila Lendvai
2024-01-21  9:38 ` Attila Lendvai
2024-01-21 17:49   ` Maxim Cournoyer
2024-01-22 18:38     ` Attila Lendvai
2024-01-23 13:21       ` Maxim Cournoyer
2024-01-24 10:56         ` Attila Lendvai [this message]
2024-01-24 13:56           ` Maxim Cournoyer
2024-01-24 16:41             ` Zheng Junjie
2024-01-24 19:23               ` Maxim Cournoyer
2024-01-24 17:11 ` Attila Lendvai
2024-01-26  9:50   ` [OT: s/Joshua/Josiah/ in sig ;-] " bokr
2024-01-26 21:50     ` [OT: s/Joshua/Josiah/ in sig ; -] " Attila Lendvai
2024-04-02 10:43 ` Attila Lendvai
2024-04-10 16:32 ` Ludovic Courtès
2024-04-18 12:15   ` Attila Lendvai
2024-05-23 17:48     ` Attila Lendvai
2024-05-24 16:57       ` Attila Lendvai
2024-05-26 19:02         ` Attila Lendvai

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='nrHrlp1sx6ty3OocRLevfyy0fEKmWjgSUbJd79Dixpxmu0t3wSj1v8Xa9wE8T-8zjUGm3m-g4Ms6XpC-o6FqzcIUK4ObM5afHdCg07wUnmw=@lendvai.name' \
    --to=attila@lendvai.name \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    --cc=maxim.cournoyer@gmail.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).