Skip to contentSkip to conversation

hwclock: clean up messages

PATCH In review JWP 3 participants 7 messages Oct 24, 2014 Util-Linux package

lore
Share & tools
lore

JWP

author
#0 lore raw

cover hwclock: clean up messages

This patch set cleans up various message output.
It contains cosmetic changes only.

J William Piggott (5):
hwclock: Remove newline from 'date' debug output
hwclock: clean up message periods/full stops
hwclock: add message line breaks
hwclock: Fix --date debug messages
hwclock: version prints out of order

 sys-utils/hwclock.c | 145 ++++++++++++++++++++++++++--------------------------
 1 file changed, 73 insertions(+), 72 deletions(-)
maintainer
#1 lore raw
Quoted 9 lines · JWP

This patch set cleans up various message output.
It contains cosmetic changes only.

J William Piggott (5):
hwclock: Remove newline from 'date' debug output
hwclock: clean up message periods/full stops
hwclock: add message line breaks
hwclock: Fix --date debug messages
hwclock: version prints out of order

I'm going to merge these patches, but as a long term solution it would better to use include/debug.h stuff (see for example misc-utils/whereis.c or libmount/src/init.c).

The debug.h provides more elegant way for debug messages. It's possible to define mask to specify wanted messages and all is controlled by <NAME>_DEBUG= env. variable etc.

It's probably too verbose for hwclock --debug, but let's ignore this problem for now. I'll make the output more user friendly ASAP.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
author
#2 lore raw
Quoted 15 lines · Karel Zak
Quoted 9 lines · JWP

This patch set cleans up various message output.
It contains cosmetic changes only.

J William Piggott (5):
hwclock: Remove newline from 'date' debug output
hwclock: clean up message periods/full stops
hwclock: add message line breaks
hwclock: Fix --date debug messages
hwclock: version prints out of order

I'm going to merge these patches, but as a long term solution it would better to use include/debug.h stuff (see for example misc-utils/whereis.c or libmount/src/init.c).

Quoted 6 lines

The debug.h provides more elegant way for debug messages. It's possible to define mask to specify wanted messages and all is controlled by <NAME>_DEBUG= env. variable etc.

It's probably too verbose for hwclock --debug, but let's ignore this problem for now. I'll make the output more user friendly ASAP.

Cool, I was not aware of debug.h. I will check it out and include it in my hwclock refactoring todo notes.

Quoted 3 lines

Karel

#3 lore raw
In reply to Karel Zak
Quoted 4 lines · Karel Zak
Quoted 3 lines · JWP

This patch set cleans up various message output.
It contains cosmetic changes only.

Quoted 8 lines
Quoted 6 lines

J William Piggott (5):
hwclock: Remove newline from 'date' debug output
hwclock: clean up message periods/full stops
hwclock: add message line breaks
hwclock: Fix --date debug messages
hwclock: version prints out of order

I'm going to merge these patches,

Please no. Not the mere period and linebreak changes.

Quoted 3 lines

but as a long term solution it would
better to use include/debug.h stuff (see for example misc-utils/whereis.c or libmount/src/init.c).

In hwclock the "debug" messages are gettextized, because in fact they are verbose messages to help the user understand what hwclock is doing. They are not meant to find programming errors in hwclock; if that were the case, they wouldn't be gettextized, because a programmer needs to be able to read an write English anyway.

Benno

Signature · 1 line
http://www.fastmail.fm - Does exactly what it says on the tin
maintainer
#4 lore raw
Quoted 13 lines · Benno Schulenberg
Quoted 11 lines · Karel Zak
Quoted 9 lines · JWP

This patch set cleans up various message output.
It contains cosmetic changes only.

J William Piggott (5):
hwclock: Remove newline from 'date' debug output
hwclock: clean up message periods/full stops
hwclock: add message line breaks
hwclock: Fix --date debug messages
hwclock: version prints out of order

Quoted 3 lines
Quoted 1 line

I'm going to merge these patches,

Please no. Not the mere period and linebreak changes.

Thanks for review, that's reason why I usually wait at least a day.. :-)

Quoted 5 lines
Quoted 3 lines

but as a long term solution it would
better to use include/debug.h stuff (see for example misc-utils/whereis.c or libmount/src/init.c).

In hwclock the "debug" messages are gettextized, because in fact

ah..

Quoted 4 lines

they are verbose messages to help the user understand what hwclock is doing. They are not meant to find programming errors in hwclock; if that were the case, they wouldn't be gettextized, because a programmer needs to be able to read an write English anyway.

Good point, then it would be better to keen --debug independent on HWCLOCK_DEBUG=.

But I still think that for so complex tool like hwclock we need a real debug output for developers / bug reporters. The current --debug is more like --verbose we have in another tools.

Larel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
author
#5 lore raw
In reply to Benno Schulenberg
Quoted 9 lines · Benno Schulenberg
Quoted 1 line · Karel Zak

On Thu, Oct 23, 2014 at 10:44:31PM -0400, JWP wrote:

In hwclock the "debug" messages are gettextized, because in fact they are verbose messages to help the user understand what hwclock is doing. They are not meant to find programming errors in hwclock; if that were the case, they wouldn't be gettextized, because a programmer needs to be able to read an write English anyway.

I would agree that it should have been named --verbose. However, I have not suggested it because of Util-linux guidelines:

Quoted 1 line

From util-linux//Documentation/howto-usage-function.txt

"The rule of thumb with other options is that once they exist, you may not change them, nor change how they work, nor remove them."

The --debug output is useful for testing and debugging, as I have used it as such many times.

Quoted 3 lines

Benno

#6 lore raw
Quoted 7 lines · JWP

I would agree that it should have been named --verbose. However, I have not suggested it because of Util-linux guidelines:

From util-linux//Documentation/howto-usage-function.txt

"The rule of thumb with other options is that once they exist, you may not change them, nor change how they work, nor remove them."

Sure. But that does not mean you cannot add a synonym for --debug, say --verbose, and document it, and undocument the original --debug (but still recognize it and act upon it, just like in hwclock -v is still recognized as a synonym of -V). And then in a couple of years print a deprecation warning when --debug is used, and then remove it another two years later.

When you are going to refactor hwclock, many messages are going to change anyway, and if anyone has become dependent on the --debug messages, they will have to modify their scripts anyway; it will then be a small trouble to change --debug to --verbose. The rule of thumb is mainly for options that people tend to use in scripts; you don't want to break those without a very good reason.

Benno

Signature · 2 lines
http://www.fastmail.fm - One of many happy users:
  http://www.fastmail.fm/help/overview_quotes.html