Hi Nathan and Max,

I think with John ZuHone's recent patches, we're no longer using basicConfig -- so you should be able to apply new handlers for file output now.  I think the object is called yt_sh in yt.utilities.logger.

-Matt

On Thu, Jan 8, 2015 at 2:58 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
Hi Max,

On Wed, Jan 7, 2015 at 4:30 PM, Max Katz <maxpkatz@gmail.com> wrote:
Hi all,

A glance at the source code (utilities/logger.py) indicates to me that yt is using the Python logging package for output information, and that depending on the choice of the option stdoutStreamLogging, this can be directed to either stdout or stderr. Since there's a lot of information piped to stdout whenever a dataset is opened, and this can tend to overwhelm any other information that is being displayed to screen it would be nice if the logging output could be redirected to a file. This can be done when setting the basicConfig for the logger when setting it up, but that page indicates that this configuration cannot be overridden after it has initially been set. Is there a way to include an option in yt for the user to direct the logging output to a file of their choice?

Not at the moment, no.  

Of course, you can always redirect the output of a script to a file:

python my_script.py > all_output 2>&1

To make it so only logging statements get redirected, and not all stdout and stderr, we could probably add a configuration option (see yt/config.py) to specify a file where logging items should be dumped to.  If you'd be interested, I think this would be a straightforward initial contribution to yt.
 


Max Katz
Department of Physics and Astronomy
Vice President, Graduate Student Organization
Stony Brook University
http://astro.sunysb.edu/mkatz/

_______________________________________________
yt-users mailing list
yt-users@lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org



_______________________________________________
yt-users mailing list
yt-users@lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org