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 v4 0/7] Make log-msg accept source properties for displaying source location Date: Sun, 25 Feb 2024 09:19:06 -0500 Message-ID: <20240225141935.8420-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="14912"; 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 Sun Feb 25 15:20:15 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 1reFMU-0003ep-Ns for guile-devel@m.gmane-mx.org; Sun, 25 Feb 2024 15:20:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reFM4-0002Kf-HW; Sun, 25 Feb 2024 09:19:48 -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 1reFM0-0002JW-Pp for guile-devel@gnu.org; Sun, 25 Feb 2024 09:19:44 -0500 Original-Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1reFLy-0004RS-Vo for guile-devel@gnu.org; Sun, 25 Feb 2024 09:19:44 -0500 Original-Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-787ab7b56efso112842385a.2 for ; Sun, 25 Feb 2024 06:19:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708870781; x=1709475581; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=LArZnqjQEXNRlGYcvzFmUY++kUV4P7O+22u7+sSqnrw=; b=c+YBPDzR3SjA0ZCtIPhqLZM3S3Jokx0VAym3Uw0QTUXwjEz4f5+cr2sAsdvLmJZhPY t381Wma7+/A0nsXMC2eAawFfWaxnL3ny+WOp4LzuYK4nQPT5MmgRCOaX7EMDtTd1CE3S YooRl3UajKqkwBPjDyNbkXin0GFkRXI7Qd8qyhDoHrmdcOOY4GS36lRj5n3JbEZ3hdPc SRUeBXimpwL6rhJkLdLYJ1Y5t559syywSinZ0t0GE5Wrh3RaZbqWtqcEhRPJQn54nqkT +EXSHGwW/rapTkWhmkM5hi+a6hz2MqXGVyiPjNAqVBclq5ZjDJpr6WB2xx/EIiTmwaeF iXCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708870781; x=1709475581; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LArZnqjQEXNRlGYcvzFmUY++kUV4P7O+22u7+sSqnrw=; b=m/hyixy8qrkQMHCC1fXoHM/R4BO4fb/Yc8t7zTJQpRwJ3y6/xEg56xgwensKk5L+6e ZjxN/OkaCMlfvkRCENyybX4p4yKpbMW0YqLiQDOl0Rs6rtTUvVkAvZ9aw6RsNHSwTy+N bSe3zxOxPNYbbf6PXWhB5+q2zELOL53cxI1pZdNdcRm1fbvQbZqkT+A8+52xA2s+fhfd 4+X9/KwR3u2msImWlskqYoSg4cfBToCe4siCP3UqBGHcIXbFIkV5vqU/q9vclCGTk1G+ 4zc8VMlm51IgctSuoDIUg2ilZ0s3m0vYSo2ymKEOHYpkazrEg3tY4ngnznout9/fRPvt /ApQ== X-Gm-Message-State: AOJu0YwFzFGQPUwJgJ+RlLXbLX+c78GBnBUw43PGx0zdMl/GnhZhXDPT wRw3uR7AbYPWSDsD+pKYqF2smggW2YLO8Yqf7g+XzInX2aySl7EWXuJ5Gkfo X-Google-Smtp-Source: AGHT+IEQlXKeK7L7aLSZoRnlIz3Av2DzL5bo3YFLSkt4NV7iWFnEuwmZjly03i74k/klVtIS3NPukg== X-Received: by 2002:a0c:e488:0:b0:68f:4a0d:30c6 with SMTP id n8-20020a0ce488000000b0068f4a0d30c6mr5716298qvl.38.1708870780830; Sun, 25 Feb 2024 06:19:40 -0800 (PST) Original-Received: from localhost.localdomain (dsl-141-6.b2b2c.ca. [66.158.141.6]) by smtp.gmail.com with ESMTPSA id kr2-20020a0562142b8200b0068fcaa599f6sm1780591qvb.67.2024.02.25.06.19.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 06:19:40 -0800 (PST) X-Mailer: git-send-email 2.41.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::733; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qk1-x733.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:22323 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, for example [0]) 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. [0] https://issues.guix.gnu.org/68946 Changes in v4: - Reword commit messages per David's preference - log-helper's source-properties argument is now a keyword argument - original accept-log method restored (on top of new one) 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 | 109 ++++++++++----- unit-tests/guile-library.api | 247 ++-------------------------------- unit-tests/logging.logger.scm | 18 ++- unit-tests/update-api | 2 +- 5 files changed, 103 insertions(+), 275 deletions(-) base-commit: 8d0196230f80afcf4da33917fe8ae390a1560931 -- 2.41.0