Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more on log files #30

Open
kflamm opened this issue Jul 29, 2017 · 2 comments
Open

more on log files #30

kflamm opened this issue Jul 29, 2017 · 2 comments

Comments

@kflamm
Copy link

kflamm commented Jul 29, 2017

Hi. Just wanted to point out that while "import os" in cell above enables writing of log file, it also seems to turn off output to the Jupyter notebook. So you can have one or the other, but not both-- output to Jupyter notebook and a log file. It would be nice to be able to get both-- command window output to Jupyter AND a log file. A nice enhancement if there is an easy way to do this.

Thanks again for writing this terrific Stata magic...

@TiesdeKok
Copy link
Owner

Re-reading your previous issue I realized that I misunderstood the problem. Yes, the way that ipystata captures the output is by opening up a log file, and Python will monitor this log-file to create the output shown in the Jupyter Notebook. In my perception the notebook becomes the log file on steroids so I have never tried to also save a log file while using ipystata with the Jupyter Notebook.

Having said that, looking at the help file for log I believe you should be able to create your own log file without interfering with the main log file by using the name(...) argument, like: log using mylog, replace name(mylog).

From the help file:

name(logname) specifies an optional name you may use to refer to the log
        while it is open.  You can start multiple log files, give each a
        different logname, and then close, temporarily suspend, or resume
        them each individually.  The default logname is <unnamed>.

I don't have the ability to test it myself right now, but if it doesn't work let me know and we can figure out a way to make it work.

@kflamm
Copy link
Author

kflamm commented Jul 29, 2017

I will give it a try and let you know.

              Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants