unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Sjoerd van Leent <svanleent@gmail.com>
To: guile-devel@gnu.org
Subject: Re: Discussion for %display-auto-compilation-messages (and --no-auto-compilation-messages option)
Date: Mon, 03 Mar 2014 16:17:46 +0100	[thread overview]
Message-ID: <53149D1A.6090603@gmail.com> (raw)
In-Reply-To: <87a9d8tib7.fsf@gnu.org>

I see where you are going and personally, I like the suggestion.

In any case, couldn't there be an approach similar to those used with 
most logging frameworks. In GLib, there are the following options:

G_LOG_LEVEL_ERROR
G_LOG_LEVEL_CRITICAL
G_LOG_LEVEL_WARNING
G_LOG_LEVEL_MESSAGE
G_LOG_LEVEL_INFO
G_LOG_LEVEL_DEBUG

I have no clue yet which ports exist, aside from (current-output-port), 
(current-warning-port) and (current-error-port).

I imagine to create 5 virtual ports: (current-debug-port), 
(current-info-port), (current-message-port), (current-warning-port) and 
(current-critical-port). These would either be hooked up to the 
(current-output-port), except for (current-critical-port) which should 
be hooked up to (current-error-port).

The normal guile operation would be to have warning, critical and error 
messages to be fired. Guile should then get two additional options:

--verbosity=<level>, where level should be "debug", "info", "message", 
"warning", "critical" and "error".
--quiet, which suggests to skipp verbosity altogether and to display 
nothing anymore aside from writes to (current-output-port).

Guile should by default function in the "info" verbosity mode.

If verbosity is a nice fluid, one could change the verbosity level when 
deemed necessary.

And I would be happy to work this out.

On 03/02/14 22:13, Ludovic Courtès wrote:
> Hi,
>
> Sjoerd van Leent <svanleent@gmail.com> skribis:
>
>> -  scm_puts_unlocked (";;; compiling ", scm_current_error_port ());
>> -  scm_display (source, scm_current_error_port ());
>> -  scm_newline (scm_current_error_port ());
>> +  if (scm_is_true (*scm_loc_display_auto_compilation_messages))
>> +    {
>> +      scm_puts_unlocked (";;; compiling ", scm_current_error_port ());
>> +      scm_display (source, scm_current_error_port ());
>> +      scm_newline (scm_current_error_port ());
>> +    }
> FWIW, I think the approach should rather be to have a special port (a
> fluid) for such things, say, ‘current-notification-port’.  We’d simply
> replace scm_current_error_port by scm_current_notication_port above.
>
> The command-line option could be --quiet.  It would bind both
> current-notification-port and current-warning-port to a void port.
>
> WDYT?  Would you like to adjust the patch accordingly?
>
> Thanks,
> Ludo’.
>
>




  reply	other threads:[~2014-03-03 15:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-01 22:08 Discussion for %display-auto-compilation-messages (and --no-auto-compilation-messages option) Sjoerd van Leent
2014-03-02 21:13 ` Ludovic Courtès
2014-03-03 15:17   ` Sjoerd van Leent [this message]
2014-03-25 20:58   ` Andy Wingo
2014-03-25 21:20     ` Ludovic Courtès
2014-03-26  2:34       ` Mark H Weaver
2014-03-26  3:19         ` Mark H Weaver
2014-03-26  8:18           ` Andy Wingo

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://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53149D1A.6090603@gmail.com \
    --to=svanleent@gmail.com \
    --cc=guile-devel@gnu.org \
    /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.
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).