Re: [sbt] Why does logging only go to stdout and not stderr?

383 views
Skip to first unread message

Mark Harrah

unread,
Aug 4, 2013, 7:48:07 PM8/4/13
to simple-b...@googlegroups.com
Hi Andy,

Sorry I missed this or forgot to respond or whatever it was...

On Tue, 28 May 2013 23:59:52 -0700 (PDT)
Andrew MacKinlay <adma...@gmail.com> wrote:

> Hi,
>
> I'm just wondering why SBT combines the stdout output of my program (when
> using "run-main") with its own logging stream. From what I've seen
> elsewhere, it even merges the stdout/stderr streams from my program and
> outputs them to stdout (I haven't tried this, and I think it might only be
> when forking).

It is probably only for forking and if it is the case, please open a bug.

> Why can't we just use stdout/stderr as they were designed? Stderr is a
> great place for logging output to go, and if the logging stream was in a
> separate stream to my program's stdout, it would be trivial to redirect all
> my program output when using "run-main" to a file, while leaving the SBT
> logging on screen where it belongs. As it is, this logging all ends up in
> my redirected output, which is definitely not ideal.

This makes sense to me. This bug is now for changing this: https://github.com/sbt/sbt/issues/840.

> It would be great if there were a configuration parameter to make the
> SBT-internal logging go to stderr, so then we could have nice separate
> streams for data and error output. Is there some technical reason why this
> is difficult to do?

It isn't fundamentally difficult. There is the work of changing the few System.out references to System.err, but the bigger issue is whether it should just be switched over in the next .0 release, potentially breaking scripts, or if there is a smoother migration path.

-Mark

> Andy
>
> --
> You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to simple-build-t...@googlegroups.com.
> To post to this group, send email to simple-b...@googlegroups.com.
> Visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Reply all
Reply to author
Forward
0 new messages