Skip to contentSkip to conversation

quiet vs verbose

Fuego Daniel Sangorrin 2 participants 5 messages Jun 7, 2018 – Jun 28, 2018 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hi Tim,

I am trying to move from ftc manual argument parsing into argparse. Why do we have quiet, debug and verbose variables?
Are they all necessary?

Thanks,
Daniel

#1 lore raw
Quoted 6 lines

-----Original Message-----
From: Daniel Sangorrin

I am trying to move from ftc manual argument parsing into argparse. Why do we have quiet, debug and verbose variables?
Are they all necessary?

They serve different purposes.
The main intent of 'quiet' is to cause ftc to produce machine-readable output. This is for things like lists, the elements of which would be used to do additional queries or operations, possibly under web-based control. it is intended to remove human-friendly "decorations" on the output. 'quiet' is for automating use of 'ftc'.

The main intent of 'verbose' is to cause ftc to produce more user-oriented human-readable content (with more information about operations being performed, or nicer indentation, etc.)

The main intent of 'debug' is for out-of-the-ordinary messages, which are only interesting to developers (or end users desperate to see why something
is going wrong). Usually, I don't advertise the --debug option for my
command line tools (that is, I don't mention it in the help). Now that --debug is coalescing with FUEGO_DEBUG, it somewhat complicates this particular flag and it's meaning.

I don't know how this squares with what you want to do with argparse. Only some routines use quiet, but we can make these flags all global, and just have them have no effect when they don't make any sense. Let me know what you think.
-- Tim

#2 lore raw
Quoted 31 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Tuesday, June 12, 2018 12:27 PM
To: [email protected]; [email protected]
Subject: RE: [Fuego] quiet vs verbose

Quoted 6 lines

-----Original Message-----
From: Daniel Sangorrin

I am trying to move from ftc manual argument parsing into argparse. Why do we have quiet, debug and verbose variables?
Are they all necessary?

They serve different purposes.
The main intent of 'quiet' is to cause ftc to produce machine-readable output. This is for things like lists, the elements of which would be used to do additional queries or operations, possibly under web-based control. it is intended to remove human-friendly "decorations" on the output. 'quiet' is for automating use of 'ftc'.

The main intent of 'verbose' is to cause ftc to produce more user-oriented human-readable content (with more information about operations being performed, or nicer indentation, etc.)

The main intent of 'debug' is for out-of-the-ordinary messages, which are only interesting to developers (or end users desperate to see why something
is going wrong). Usually, I don't advertise the --debug option for my
command line tools (that is, I don't mention it in the help). Now that --debug is coalescing with FUEGO_DEBUG, it somewhat complicates this particular flag and it's meaning.

Quoted 5 lines

I don't know how this squares with what you want to do with argparse. Only some routines use quiet, but we can make these flags all global, and just have them have no effect when they don't make any sense. Let me know what you think.
-- Tim

Thanks for the explanation.

What do you think about these usage?

default: machine readable output (like previous "quiet")
-q: no output at all
-v: verbose (like previous "not quiet")
-vv: more verbose (like previous "verbose")
-vvv: ftc debug messages (like previous "debug")
--debug: parameter for FUEGO_DEBUG that has no effect on ftc (passed only to add-jobs and run-test)

Regards,
Daniel

A message that is not in the archive (sent off-list or not yet received): CA+bK7J4_MFnEzNW0UiJoPX7siXEXhX5xr5aV77PiVUm82-dSEg@mail.gmail.com

#4 lore raw
Quoted 23 lines

-----Original Message-----
From: Tim Bird <[email protected]>
Sent: Saturday, June 16, 2018 6:54 PM
To: Daniel Sangorrin <[email protected]>
Subject: Re: [Fuego] quiet vs verbose

Quoted 2 lines · Daniel Sangorrin
Quoted 2 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]]

...

Quoted 4 lines

What do you think about these usage?

default: machine readable output (like previous "quiet") -q: no output at all

This is probably better, as that's what most users would expect

Review

Quoted 4 lines
(quoted diff) +0 -4
-v: verbose (like previous "not quiet")
-vv: more verbose (like previous "verbose")
-vvv: ftc debug messages (like previous "debug")
--debug: parameter for FUEGO_DEBUG that has no effect on ftc (passed only to

add-jobs and run-test)

Quoted 3 lines

I like some of these distinctions, but would prefer the following:

-q: no output at all.

Thinking twice, the user can always redirect output to /dev/null. For that reason, we don't really need this option, do we?

Review

Quoted 3 lines

(no options): same as now (human readable, non-verbose)

(quoted diff) +0 -2
-v: same as now (human readable, verbose)
-v-: what -q used to be (machine readable, or "not verbose")

humm It looks a bit weird to me.
How about --machine-readable? (explicit, long but easy to understand)
Note: using --machine-readable and -v or --debug at the same time should give an error?

Quoted 6 lines

--debug xx: used for debug, but with one bit reserved for ftc internal debug (16)
(so, '--debug 16' would be the equivalent of the old '--debug', and '--debug 31' would debug
everything, including ftc. Turning on flags for operations not performed (e.g. the parser debug flag, when you're doing 'ftc list-nodes', would have no effect.

I would rather separate the API from the implementation. For example, instead
of using bitmaps in the API we can use easy-to-remember words like "--debug ftc,parser,charting". Then, it will be easy to change the implementation if we happen to run out of bits.

Thanks,
Daniel

#5 lore raw
Quoted 23 lines

-----Original Message-----
From: Daniel Sangorrin

Quoted 10 lines

-----Original Message-----
From: Tim Bird <[email protected]>

Quoted 2 lines · Daniel Sangorrin
Quoted 2 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]]

...

Quoted 2 lines

What do you think about these usage?

Quoted 8 lines
Quoted 2 lines

default: machine readable output (like previous "quiet") -q: no output at all

This is probably better, as that's what most users would expect

Review

Quoted 4 lines
(quoted diff) +0 -4
-v: verbose (like previous "not quiet")
-vv: more verbose (like previous "verbose")
-vvv: ftc debug messages (like previous "debug")
--debug: parameter for FUEGO_DEBUG that has no effect on ftc (passed

only to

Quoted 8 lines
Quoted 5 lines

add-jobs and run-test)

I like some of these distinctions, but would prefer the following:

-q: no output at all.

Thinking twice, the user can always redirect output to /dev/null. For that reason, we don't really need this option, do we?

You're right. I don't think we need an option for no output at all. I can't think of an operation that ftc does where this makes sense.

Quoted 7 lines

Review

Quoted 4 lines

(no options): same as now (human readable, non-verbose)

(quoted diff) +0 -2
-v: same as now (human readable, verbose)
-v-: what -q used to be (machine readable, or "not verbose")

humm It looks a bit weird to me.
How about --machine-readable? (explicit, long but easy to understand)

That's OK with me. Can we leave an undocumented '-q' in just for my convenience? Odd as it sounds, I sometimes use the machine-readable format on the command line.

Quoted 2 lines

Note: using --machine-readable and -v or --debug at the same time should give an error?

Yes.

Quoted 8 lines
Quoted 6 lines

--debug xx: used for debug, but with one bit reserved for ftc internal debug (16)
(so, '--debug 16' would be the equivalent of the old '--debug', and '--debug 31' would debug
everything, including ftc. Turning on flags for operations not performed

(e.g.

Quoted 1 line

the parser debug flag, when you're doing 'ftc list-nodes', would have no

Quoted 8 lines

effect.

I would rather separate the API from the implementation. For example, instead
of using bitmaps in the API we can use easy-to-remember words like "-- debug ftc,parser,charting".
Then, it will be easy to change the implementation if we happen to run out of bits.

That's a great idea. It's easier to understand for the user, and the code to handle It will be easier to maintain and extend for developers. The bitmask idea is probably just a leftover idea from my C programming days that is better left behind. I need to get with the times and start using strings for things. One thing - it might be nice to have a shorthand for all items, like "--debug all".

-- Tim