Is log_html() deprecated?

27 views
Skip to first unread message

Jin Guu

unread,
Apr 29, 2020, 10:08:56 AM4/29/20
to sage-support
I'd like to log my entire session in sage into a file. The best solution I found is to use log_html().


But the functions seems deprecated, and the document about it I've found is more than a decade.




sage: log_html()
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-5-a8d814def110> in <module>
----> 1 log_html()

NameError: name 'log_html' is not defined
sage: log_html
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-6-ff0f45b830f3> in <module>
----> 1 log_html

NameError: name 'log_html' is not defined

Dima Pasechnik

unread,
Apr 29, 2020, 11:29:38 AM4/29/20
to sage-support
you need to import it before using:

from sage.misc.log import log_html




--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/36adf193-74bb-4c7d-9ec2-7f822bba9625%40googlegroups.com.

Jin Guu

unread,
Apr 29, 2020, 5:02:05 PM4/29/20
to sage-support
Apology for more stupid questions. I imported and it loaded, but still failed:

sage: from sage.misc.log import log_html
sage: log_html
<class 'sage.misc.log.log_html'>
sage: log_html()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-30-a8d814def110> in <module>
----> 1 log_html()

/usr/lib/python3.8/site-packages/sage/misc/log.py in __init__(self, dir, debug, viewer)
     97         self._dir = dir
     98         self._filename = os.path.join(dir, self._filename())
---> 99         self._output = __IPYTHON__.output_hist
    100         self._input  = __IPYTHON__.input_hist_raw
    101         self._text = ''

AttributeError: 'bool' object has no attribute 'output_hist'
sage:

Dima Pasechnik

unread,
Apr 29, 2020, 5:12:16 PM4/29/20
to sage-support
Yes, it is a bug.
I opened https://trac.sagemath.org/ticket/29621
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/22463a0c-9d82-4d87-8c1d-68ff15ac5f9d%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages