View previous topic :: View next topic |
Author |
Message |
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Wed Jan 25, 2006 12:24 pm Post subject: |
|
|
larsivi wrote: | Well, the last one matches Stdout.println in functionality and might be better if you're sure it will always work. |
It only worked with Stdout.println when asserts were compiled out ~ t'was a bug waiting to happen (using radix 's' ~ all conversions go through Integer.convert)
What does writef() do? |
|
Back to top |
|
|
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Wed Jan 25, 2006 12:27 pm Post subject: |
|
|
kris wrote: | larsivi wrote: | Well, the last one matches Stdout.println in functionality and might be better if you're sure it will always work. |
It only worked with Stdout.println when asserts were compiled out ~ t'was a bug waiting to happen (using radix 's' ~ all conversions go through Integer.convert)
What does writef() do? |
In general, it just works with writef. Whether it is supposed to or not, I don't know |
|
Back to top |
|
|
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Wed Jan 25, 2006 6:49 pm Post subject: |
|
|
OK ~ I'll map ?s onto ?d |
|
Back to top |
|
|
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Thu Feb 09, 2006 2:26 pm Post subject: Pipes |
|
|
Is it possible to pipe mango.log output? I get some largish output and want to grep it directly, eg "foo | grep 'bar'" where foo is the program and bar what I search for. But it seems to just print everything in any case.
I'm using a latish mango svn and Kubuntu Breezy. |
|
Back to top |
|
|
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Thu Feb 09, 2006 3:19 pm Post subject: Re: Pipes |
|
|
larsivi wrote: | Is it possible to pipe mango.log output? I get some largish output and want to grep it directly, eg "foo | grep 'bar'" where foo is the program and bar what I search for. But it seems to just print everything in any case.
I'm using a latish mango svn and Kubuntu Breezy. |
Console logging is sent to stderr ~ can you hook a pipe to that? |
|
Back to top |
|
|
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Thu Feb 09, 2006 3:46 pm Post subject: |
|
|
Alternatively, you might attach a FileLogger to the appropriate part of the log-tree? |
|
Back to top |
|
|
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Thu Feb 09, 2006 3:49 pm Post subject: |
|
|
kris wrote: | Alternatively, you might attach a FileLogger to the appropriate part of the log-tree? |
Nah, it's only about convenience.
I can use named pipes (thanks h3r3tic) like this:
Code: |
mkfifo myFifo
foo 2> myFifo &
cat myFifo | grep 'bar'
rm myFifo
|
And it is as easy/not easy as using files. |
|
Back to top |
|
|
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Mon Feb 13, 2006 11:31 am Post subject: |
|
|
Hmm, just wondering, wouldn't it be possible to have a Stdout appender and a Stderr appender, so I could choose? I don't consider all the output as stderr stuff. |
|
Back to top |
|
|
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Tue Feb 14, 2006 1:30 pm Post subject: |
|
|
larsivi wrote: | Hmm, just wondering, wouldn't it be possible to have a Stdout appender and a Stderr appender, so I could choose? |
Don't see why not
Alternatively, I suppose one might change ConsoleAppender to handle both (since there's no additional imports needed). Perhaps a boolean ctor argument that defaults to Stderr, and then an indirection on Cerr/stderr & Cout/stdout instead of the direct call? Kind of a toss-up as to which way to go, since making the ConsoleAppender be an abstract-baseclass instead would certainly make sense also. I'd perhaps choose the latter if we could skirt around backward compatability concerns.
What do you think? |
|
Back to top |
|
|
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Tue Feb 14, 2006 2:06 pm Post subject: |
|
|
kris wrote: | larsivi wrote: | Hmm, just wondering, wouldn't it be possible to have a Stdout appender and a Stderr appender, so I could choose? |
Don't see why not
Alternatively, I suppose one might change ConsoleAppender to handle both (since there's no additional imports needed). Perhaps a boolean ctor argument that defaults to Stderr, and then an indirection on Cerr/stderr & Cout/stdout instead of the direct call? Kind of a toss-up as to which way to go, since making the ConsoleAppender be an abstract-baseclass instead would certainly make sense also. I'd perhaps choose the latter if we could skirt around backward compatability concerns.
What do you think? |
Whatever you think is best I'm not deep into the usage anyhow. |
|
Back to top |
|
|
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Tue Feb 14, 2006 5:01 pm Post subject: |
|
|
larsivi wrote: | Whatever you think is best I'm not deep into the usage anyhow. |
OK. I'll probably subclass since that will allow one to emit to both stdout & stderr, if one so desired. |
|
Back to top |
|
|
|