From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: New (only?) extensible logging package for Emacs Date: Mon, 13 Mar 2023 18:47:54 +0200 Message-ID: <834jqotx6t.fsf@gnu.org> References: <875yb7tnyd.fsf@gmail.com> <87bkkyuqkb.fsf@localhost> <87pm9cpyps.fsf@gmail.com> <83edpsu340.fsf@gnu.org> <87fsa8mykq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31078"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yantar92@posteo.net, emacs-devel@gnu.org To: =?utf-8?B?TWF0w7rFoQ==?= Goljer Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 13 17:48:51 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 1pblLv-0007r4-DH for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Mar 2023 17:48:51 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pblLC-0005Wb-HF; Mon, 13 Mar 2023 12:48:06 -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 1pblLB-0005W8-0s for emacs-devel@gnu.org; Mon, 13 Mar 2023 12:48:05 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pblLA-0007hv-Go; Mon, 13 Mar 2023 12:48:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=IkiT72Fg7Vv8Hc635oR7AF3cl/omRX8fNW0Q4x8rdQw=; b=qV8kNzoNgPE8Ntb2Wxhl 87IZPMDHizUUyw88ulwSWN3vV0RElOt/e4UwxjCtkKvwS5B8QLgIQv/kmVbttPqdqZ94hyLPfdXZV S54LiNG9xAc1CHAL77Jz7nUmXgos9Xw/bgh6uFbhP0uROgTlnOhNMSFjJJEm6JoWFWahySV6mHdrL Xc/HFsvuaAHRhctdV/s6yLGA+IQoOjhtlq3Qww2dfcJD0nAvOo0EgVtPVS4Aw6YI4lYvEc3f6qxSM 2Vb8Sl3/sd3B7M02MSBWrMDFDYRuk8f6lNuuxAbhJAG/kpVEBHNhibtW8ytFO6RVeJ9dvvfJqJG6J Ayba6hXljvyz2g==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pblL9-00011q-QG; Mon, 13 Mar 2023 12:48:04 -0400 In-Reply-To: <87fsa8mykq.fsf@gmail.com> (message from =?utf-8?B?TWF0w7o=?= =?utf-8?B?xaE=?= Goljer on Mon, 13 Mar 2023 16:59:49 +0100) 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:304405 Archived-At: > From: Matúš Goljer > Cc: yantar92@posteo.net, emacs-devel@gnu.org > Date: Mon, 13 Mar 2023 16:59:49 +0100 > > Eli Zaretskii writes: > > > 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. *Messages* is not the best idea: in any long-running session, it is full of uninteresting messages, and also wraps around after message-log-max messages (and the default value of message-log-max is quite low for serious logging). So yes, I think these logs should go to a separate buffer. > 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. Yes. Moreover, saving a buffer to a file, either from time to time or based on some other trigger, is trivial.