On 16 January 2013 02:48, Nate Finch <
nate....@gmail.com> wrote:
> err := cmd.Run()
> if errOut.Len() > 0 {
> errLog.Printf("%s", errOut.String())
i'm not sure you want to do this - if the stderr output contains more than
one line, it'll all come out in one log message.
maybe something like this (untested):
for _, s := range strings.Split(strings.TrimRight(errOut.String(),
"\n"), "\n") {
errLog.Output(1, s)
}
as for the general "make a Writer from a log.Logger" problem,
here's an example of a solution. you might use it if you wanted
to see log messages in a timely way (probably not an issue when
using it with the go tool):
http://play.golang.org/p/ruQZM8Bhf-
> On Tuesday, January 15, 2013 5:46:34 PM UTC-5, Nate Finch wrote:
>>
>> Ahh, thanks minux. Though it was nice to discover pipes... Certainly a
>> bytes.Buffer is better. I should really just read the std lib front to back.
>
> --
>
>