bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More verbosity


From: Bruno Haible
Subject: Re: More verbosity
Date: Fri, 05 May 2023 23:15:33 +0200

Hi,

> >> 1.
> >> My primary problem is that xgettext doesn't tell me (on stdout) which
> >> source files it reads.
> > 
> > There is no particular message that gets printed for each file
> > that gets read. But...
> 
> Yes I know. That is why I reported this to request a feature for this. I 
> would assume that in first or second verbosity level informations like 
> this do appear on stdout.

I don't think such logging in xgettext is useful enough to warrant the costs.

The cost of logging code is that it adds code that distracts from the
code's main tasks and thus hampers future maintenance.

Logging is generally useful
  a) when a program does complex things, or
  b) at the boundaries between different programs or subsystems, for
     example, when a program A writes into a pipe that program B consumes.

What you are asking for, adding a logging statement when xgettext opens
a source file, is
  * not very important, because
    - xgettext reads all the files that were mentioned on the command line,
    - when there is a warning, xgettext displays the source file name and
      line number,
  * redundant, because the user can get the information through strace.

It is impossible to foresee all possible transparency/introspection needs
by users. That's why tools like
  - strace
  - ltrace
  - DTrace
  - BPFTrace
exist.

The complexity of xgettext is elsewhere, namely the parsing and tokenization
of source files. But logging each token parsed would not be useful to the
user; it is only useful to the GNU gettext developers, and they can just
as well use a debugger.

> Then take this as a bug about the manpage. It is not mentioned there.
> Mention that verbosity only works for ruby files.

I disagree that every detail needs to be mentioned in the manpage or
documentation. If a user notices that an option does not do what they
expect, they can just omit that option.

> I would like to know how verbose your software can be. How many levels
> are there and what is the difference.

Again, these are details that are not worth documenting.

The general rule should be enough: If you need more verbosity, use option
'--verbose'. If you need less verbosity, use option '--quiet' (if that
exists).

Bruno






reply via email to

[Prev in Thread] Current Thread [Next in Thread]