From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxim Cournoyer Newsgroups: gmane.lisp.guile.devel Subject: [Guile-Lib PATCH v3 0/7] Make log-msg accept source properties for displaying source location Date: Thu, 8 Feb 2024 23:50:41 -0500 Message-ID: <20240209045150.17210-1-maxim.cournoyer@gmail.com> References: <20240206034201.28494-1-maxim.cournoyer@gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16211"; mail-complaints-to="usenet@ciao.gmane.io" Cc: David Pirotte , Maxim Cournoyer To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Fri Feb 09 05:52:17 2024 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rYIs5-00041H-7X for guile-devel@m.gmane-mx.org; Fri, 09 Feb 2024 05:52:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYIrp-0006r8-Ct; Thu, 08 Feb 2024 23:52:01 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYIrn-0006qq-MA for guile-devel@gnu.org; Thu, 08 Feb 2024 23:51:59 -0500 Original-Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYIrl-0000P8-TV for guile-devel@gnu.org; Thu, 08 Feb 2024 23:51:59 -0500 Original-Received: by mail-qk1-x732.google.com with SMTP id af79cd13be357-783dc658bd9so27846385a.1 for ; Thu, 08 Feb 2024 20:51:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707454316; x=1708059116; darn=gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iDYTx4f+xnrbD0WwnLdn1NH1g5AZ6/y3orKL3Y6V2Vg=; b=cGCtPaXNLrJHMMSDOU02iBrpw7iuC6vmqrwkQpzDp6ZBjAigAAJnYsXes6BOIb4xO6 8R2WkIl6KCaKlaiTNObnPfmPtYlYJwtLk+OBIfMRVZvrbnk8H1aHEYquIpl3BFwRF/3s RAIlkySe9JJscWLdzROgzgpGyqGk+wuJ87aQZNnBTgKSXSb5SHAz89ztwnMay6su/u8N 8iYVpUA8/conk5yz5wGThD6NphUL2rtLkfA3Hv3rlBYHEnNGzFxeAB/y4XBAJJnzzbJk innUd8SBXqu8Wc6iUkn2jRkIepYpLIS1K3EbFjK8+uWyJVv5r9+D55/lNOwoGZ5SHsUj NuJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707454316; x=1708059116; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iDYTx4f+xnrbD0WwnLdn1NH1g5AZ6/y3orKL3Y6V2Vg=; b=nACpgYnsafRUT8fGfQXLAZvoB3YWF+HyVA7DRek1P4tuNW65vQIYp9ZzcU7X5uLN+9 YMknCBR6f1tipZUARtWWI4+5zL/Ngr77roRs4SnFoaTcZPdbEM3J+G6Q7dBIXxbaX0NM +zbwhMZNBaoyBMAQEz+gWD03PW9QOxQxtY1yi/RFRwe0tQwgo1UToEqUl3XX4tDgGRK/ 3qIDdRfaWOdZAu0buJ2mB5uDiUaWXye3ajGrNDEQpJFfGIZqRbPRyhahsYVXEOv7Et9s p9DfUFPo4kfXWb5cWGxrX3LyiuvZfasQnB4PbNYXW6qwUztOX81QUc6LgdSGWGmhvQi5 UMrA== X-Gm-Message-State: AOJu0YyB8Py6RWa3+/+X2vgzRBSwh2LbaojlcnTc84bx11FQx1IAHnzb mAqVzdfycPuDKcOJVXNAuAFzGpCY9mdorB1SoIzifZnNrf7k9f3GtTRfMoSz X-Google-Smtp-Source: AGHT+IEq9jEuWYgxZr7dIOu7Cxk1TmFjV1qxeO1Jjki6l3WT0YYMCmLRn1DnEwofdmC1u8RWXHeMeg== X-Received: by 2002:a05:620a:1116:b0:785:b0c2:4dff with SMTP id o22-20020a05620a111600b00785b0c24dffmr700747qkk.33.1707454316443; Thu, 08 Feb 2024 20:51:56 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVDV5X0KapwyYoDfPi7ozi5jiLn3wp0yBtYNpI0jJYKZkSmQPn59X59KkMpsXHaaZpqHP/XWdYP9S74fQuB+KsEGQKAbliqv0QV Original-Received: from localhost.localdomain (dsl-10-135-252.b2b2c.ca. [72.10.135.252]) by smtp.gmail.com with ESMTPSA id p3-20020a05620a112300b00785a2d275f0sm426970qkk.41.2024.02.08.20.51.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 20:51:55 -0800 (PST) X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240206034201.28494-1-maxim.cournoyer@gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::732; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qk1-x732.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:22310 Archived-At: The main change of this series is adding the ability to pass source properties (such as can be obtained via syntax-source in macros) to the `log-msg' call, and have the default log formatter use it to display the source location of the corresponding call. The procedure name where the log-msg call was made is also resolved and made available to the log formatter. It also fixes a few minor issues spotted while working with the source, and calls `flush-log' at the end of `accept-log' to avoid long delays caused by the default block buffering when the log traffic is low. Changes in v3: - Use (ice-9 format) for the default-log-formatter - Use a keyword argument for the source-properties - Add proc-name argument to default-log-formatter Changes in v2: - Relax log-msg typing on source-properties, as it can also be #f Maxim Cournoyer (7): configure.ac: Fix typo in message. Use /bin/sh in update-api script shebang. tests: guile-library.api: Re-generate. logging: Allow passing source properties to `log-msg'. logging: Adjust default log-formatter output. logging: Make procedure name available to the log formatter. logging: Call flush-log at the end of accept-log. configure.ac | 2 +- src/logging/logger.scm | 107 ++++++++++----- unit-tests/guile-library.api | 247 ++-------------------------------- unit-tests/logging.logger.scm | 18 ++- unit-tests/update-api | 2 +- 5 files changed, 98 insertions(+), 278 deletions(-) base-commit: 8d0196230f80afcf4da33917fe8ae390a1560931 -- 2.41.0