On 4/21/22 09:31, Rodrigo wrote:
> I forgot to add: I am using SageMath 9.0 on Ubuntu 20.04 LTS
as always in Sage, everything is an instance of some object. `magma` is
not different than everything else. Indeed, if you ask the type of the
object `magma` you will see that it is an instance of the Interface
object. For example:
Now, if you look at how this object is instantiated, you see that there
are many options you can set. In particular, there is an argument
"logfile" which is set to `None` by default. This is where you will see
the logs you want. As I mentioned, by default those logs are discarded.
To get what you want, you can create a new instance of the magma
interface where you specify a file name where everything will be logged
sage: magma_with_logs = Magma(logfile="sage_magma.log") # You can call
it magma, this will just replace the usual one.
sage: magma_with_logs.set_verbose("Code", true)
sage: C = codes.random_linear_code(GF(4), 80, 20)
And now you can look at the file sage_magma.log and see the logs you are
looking for !
Obviously, you can handle this logfile within sagemath with usual file
handling in Python. I let you experiment with that.
By the way, there has been _a lot_ of changes since SageMath 9.0 (not
about the Magma interface, but still), especially between Sage 9.0 and
9.2 (Moving to full Python 3), and currently the stable Sage version is 9.5.
But not a big deal, the new Ubuntu LTS (22.04) is out .... today ! And
it comes with Sage 9.5. I suggest you upgrade your system when you have
time to do that !