gap-packages / JupyterKernel

Native Jupyter kernel for GAP
https://gap-packages.github.io/JupyterKernel/
BSD 3-Clause "New" or "Revised" License
19 stars 12 forks source link

`LogTo` does not seem to work #15

Open pedritomelenas opened 6 years ago

pedritomelenas commented 6 years ago

May be it is in my install (macos). LogTo does not write into the file specified in the argument. Thanks, Pedro

olexandr-konovalov commented 3 years ago

I also have this on mac under GAP 4.11.1:

LogTo("testlog.txt");

results in

Error, LogTo: cannot log to testlog.txt in
  LOG_TO( expandname ); at /Users/alexk/gap/gap-4.11.1/lib/streams.gi:300 called from 
<function "LogTo for output file">( <arguments> )
 called from read-eval loop at stream:1

@ZachNewbery does this work for you in WSL on Windows?

ZachNewbery commented 3 years ago

No i get the same error unfortunately :(

olexandr-konovalov commented 3 years ago

While I'd be interested to understand why it does not work, and this should be mentioned in known limitations of the GAP Jupyter kernel (@ZachNewbery currently works on documenting them), using LogTo in Jupyter notebook is perhaps a non-Jupyter way of thinking. The notebook contains all input and output already, so why one wants to have a log (which would possibly have more, all false attempts, error messages etc.?) instead of a clean notebook? If you want to convert it to a plain text file, you can use Jupyter functionality to save the notebook as a text, and then clean it up.

slel commented 3 years ago

Note also Jupytext which lets you maintain a text version of a notebook (with only the input cells) in Markdown or reStructuredText format.

olexandr-konovalov commented 3 years ago

excellent suggestion @slel - thanks!

olexandr-konovalov commented 3 years ago

Before closing this, I'll add some text to the manual.

olexandr-konovalov commented 3 years ago

1.5 Known Limitations and Caveats now mentions this, but maybe the text could be extended with some advice from the above.