From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?B?TWF0w7rFoQ==?= Goljer Newsgroups: gmane.emacs.devel Subject: Re: New (only?) extensible logging package for Emacs Date: Mon, 13 Mar 2023 16:59:49 +0100 Message-ID: <87fsa8mykq.fsf@gmail.com> References: <875yb7tnyd.fsf@gmail.com> <87bkkyuqkb.fsf@localhost> <87pm9cpyps.fsf@gmail.com> <83edpsu340.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31464"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yantar92@posteo.net, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 13 17:48:54 2023 Return-path: Envelope-to: ged-emacs-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 1pblLx-0007ur-EO for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Mar 2023 17:48:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pblLX-0005Zs-84; Mon, 13 Mar 2023 12:48:27 -0400 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 1pbkaa-0006H3-SG for emacs-devel@gnu.org; Mon, 13 Mar 2023 11:59:56 -0400 Original-Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pbkaZ-0008WS-3D; Mon, 13 Mar 2023 11:59:56 -0400 Original-Received: by mail-ed1-x52c.google.com with SMTP id h8so6914434ede.8; Mon, 13 Mar 2023 08:59:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678723192; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=zOoLUdlD0GJNRiQ8UKNktJZYdBXXAiib4x1W4XTHcb8=; b=DxsDJwlZ0mbFmGFweqt85+qJgRq3Q+phEfr4TIaPlOSNYBUjRHdaFtFYhyLDehXX7O 4EszPzc4pqgesk9iuv0CIxJ/wx47Lveo/3/soKuKiQ/KH4lXMcgzUH5LkQZf/TGF9kXo Li6Y6nOrY8gENSEx1wZXFZ7k+0oL33qjAjZR07w6nHYcxIGthlNHaebvLLkwcbGTvkdY QPxfXwZeRUg15wTEHzPT17siK8mbXbxbGfC+YpoSZcHPTxNHTS8rKsmnWoegFh3Txzgl aTNGFS7TdiEEzQEEClavTQ8IQzyUy3/OThh8mviDRjuqMYe7NEBvcbXRVYp7OreqweHO MBFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678723192; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zOoLUdlD0GJNRiQ8UKNktJZYdBXXAiib4x1W4XTHcb8=; b=Z+UJ5k6xh6FeVoKW4s/CH3MC86Z6DQt/tkWH3wdJr6xEDTD6T7qFT5Zp0ftAruBqlZ VjKZxHXbIEJMgwQpdv27B1NLbzfF7mS2aYa8vdKvoxDdiro/i0NoL9NhR3GnpP9vFJwR /fWTLTJNVllqacorRX4HC8VF/y7sVCe+UA+ercB6jiUQ71dQHrvkP23E38kUfJ/ddVur k+yxbeM/PzTrE392KO0ghuzEnguZDn14/V+KBpmF32QxfZnE+Hzx+lRPy5p+/V05yi/i FJDZr3Rx/zXxqWHiZvTGkl58wwtp6hwcaHSVm9xLfSwsVAj5gf3U8MLuhKpjlaNDzqdk abpA== X-Gm-Message-State: AO0yUKUQoBARhXVbnOzW95gvzX7aibsew4k+Wko9xz2HfHv0Q2OMN24F CO5AVmpZzEisBFqDWPkqVI1BHYShydVrSw== X-Google-Smtp-Source: AK7set8NqxtTNh/O2s2A5+Nyr86/Dw+wWw1pNbhr/LAheexYVJXnnU2+FgJATVbZlebdW/rNpOQZYA== X-Received: by 2002:a17:907:9485:b0:8a9:f870:d259 with SMTP id dm5-20020a170907948500b008a9f870d259mr41095098ejc.48.1678723192203; Mon, 13 Mar 2023 08:59:52 -0700 (PDT) Original-Received: from parmenides (ip-89-177-55-133.bb.vodafone.cz. [89.177.55.133]) by smtp.gmail.com with ESMTPSA id bb7-20020a1709070a0700b0092b74223806sm819335ejc.209.2023.03.13.08.59.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 08:59:51 -0700 (PDT) In-Reply-To: <83edpsu340.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=matus.goljer@gmail.com; helo=mail-ed1-x52c.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 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 13 Mar 2023 12:48:26 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304406 Archived-At: Eli Zaretskii writes: >> From: Mat=C3=BA=C5=A1 Goljer >> Cc: emacs-devel@gnu.org >> Date: Mon, 13 Mar 2023 14:28:31 +0100 >>=20 >> :emergency =3D fatal >> :error =3D error >> :warning =3D warn >> ... =3D info >> :debug =3D debug >> ... =3D trace >>=20 >> In Emacs, I guess info is basically `message`, so maybe this "warnings" >> appender should `message` info level events. Trace could go to debug or >> be ignored. >>=20 >> I like to have more than one level of "debug", in some situations you >> want to only see some narrow part of the code at even higher level. > > I hope the log will end up in Emacs buffers, or at least that there > will be an option to do so. While other logging frameworks are > designed to work with programs that leave log files, in Emacs it is > customary to have the log in a buffer (and then the user can save that > buffer if needed). If you mean the "info" level logs I said we can log with message (the function), they would end up in *Messages* but of course can go to some other separate buffer. I will also add a generic buffer appender where you can give it buffer-or-name and logs will go there. > Direct writes of debug info to files is rare in Emacs (see > open-dribble-file and open-termscript as about the only examples I'm > aware of). My most immediate use-case for this package is the development of Elsa, where I also develop a Language Server for LSP and use emacs-async with async workers. Having flexible appending logic in these subprocesses allows me to use the single interface (say lgr-info) to dispatch messages to: - client via LSP notifications - parent process via async-send - CLI when running elsa from terminal All just by configuring the loggers at the start of each process. For use inside Emacs session for debugging etc, a buffer seems like an obvious log destination. --=20 Best regards, Mat=C3=BA=C5=A1 Goljer