* [PATCH nft v2] main: display errors through stderr
@ 2015-02-24 18:32 Pablo Neira Ayuso
2015-02-24 18:35 ` Patrick McHardy
0 siblings, 1 reply; 4+ messages in thread
From: Pablo Neira Ayuso @ 2015-02-24 18:32 UTC (permalink / raw)
To: netfilter-devel; +Cc: kaber, alexandre
Debugging still goes through stdout as Patrick requests.
Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1000
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
src/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main.c b/src/main.c
index b447aad..4590c30 100644
--- a/src/main.c
+++ b/src/main.c
@@ -361,7 +361,7 @@ int main(int argc, char * const *argv)
rc = NFT_EXIT_FAILURE;
out:
scanner_destroy(scanner);
- erec_print_list(stdout, &msgs);
+ erec_print_list(stderr, &msgs);
xfree(buf);
return rc;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH nft v2] main: display errors through stderr
2015-02-24 18:32 [PATCH nft v2] main: display errors through stderr Pablo Neira Ayuso
@ 2015-02-24 18:35 ` Patrick McHardy
2015-02-24 19:01 ` Pablo Neira Ayuso
0 siblings, 1 reply; 4+ messages in thread
From: Patrick McHardy @ 2015-02-24 18:35 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netfilter-devel, alexandre
On 24.02, Pablo Neira Ayuso wrote:
> Debugging still goes through stdout as Patrick requests.
>
> Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1000
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Thinking about it, EREC_INFORMATIONAL should also go to stdout I
suppose. But since we don't have any of those yet, we can change
it once we get the first message of this type.
> ---
> src/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/main.c b/src/main.c
> index b447aad..4590c30 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -361,7 +361,7 @@ int main(int argc, char * const *argv)
> rc = NFT_EXIT_FAILURE;
> out:
> scanner_destroy(scanner);
> - erec_print_list(stdout, &msgs);
> + erec_print_list(stderr, &msgs);
>
> xfree(buf);
> return rc;
> --
> 1.7.10.4
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH nft v2] main: display errors through stderr
2015-02-24 18:35 ` Patrick McHardy
@ 2015-02-24 19:01 ` Pablo Neira Ayuso
2015-02-24 19:18 ` Patrick McHardy
0 siblings, 1 reply; 4+ messages in thread
From: Pablo Neira Ayuso @ 2015-02-24 19:01 UTC (permalink / raw)
To: Patrick McHardy; +Cc: netfilter-devel, alexandre
On Tue, Feb 24, 2015 at 06:35:05PM +0000, Patrick McHardy wrote:
> On 24.02, Pablo Neira Ayuso wrote:
> > Debugging still goes through stdout as Patrick requests.
> >
> > Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1000
> > Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
>
> Thinking about it, EREC_INFORMATIONAL should also go to stdout I
> suppose. But since we don't have any of those yet, we can change
> it once we get the first message of this type.
I just remembered that bison is currently using stderr as output for
debugging.
We're also telling people to save their rulesets via:
nft list ruleset > file
If debugging still goes to stdout this will cause them problems. Not
sure yet we should use stdout for debugging.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH nft v2] main: display errors through stderr
2015-02-24 19:01 ` Pablo Neira Ayuso
@ 2015-02-24 19:18 ` Patrick McHardy
0 siblings, 0 replies; 4+ messages in thread
From: Patrick McHardy @ 2015-02-24 19:18 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netfilter-devel, alexandre
On 24.02, Pablo Neira Ayuso wrote:
> On Tue, Feb 24, 2015 at 06:35:05PM +0000, Patrick McHardy wrote:
> > On 24.02, Pablo Neira Ayuso wrote:
> > > Debugging still goes through stdout as Patrick requests.
> > >
> > > Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1000
> > > Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
> >
> > Thinking about it, EREC_INFORMATIONAL should also go to stdout I
> > suppose. But since we don't have any of those yet, we can change
> > it once we get the first message of this type.
>
> I just remembered that bison is currently using stderr as output for
> debugging.
>
> We're also telling people to save their rulesets via:
>
> nft list ruleset > file
>
> If debugging still goes to stdout this will cause them problems. Not
> sure yet we should use stdout for debugging.
I still think it makes sense since you explicitly requested it, its not
an error, its very useful to be able to pipe it to less directly and
it preserves order between regular output and debugging without doing
anything else.
I guess people simply shouldn't save their rulesets when enabling
debugging. Its not like we're doing it by default.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-02-24 19:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-24 18:32 [PATCH nft v2] main: display errors through stderr Pablo Neira Ayuso
2015-02-24 18:35 ` Patrick McHardy
2015-02-24 19:01 ` Pablo Neira Ayuso
2015-02-24 19:18 ` Patrick McHardy
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 NNTP newsgroup(s).