Opened 9 years ago

Closed 9 years ago

#11134 closed enhancement (fixed)

Add logging for Dokchitser scripts

Reported by: jdemeyer Owned by: was
Priority: minor Milestone: sage-4.7.1
Component: interfaces Keywords: dokchitser gp
Cc: Merged in: sage-4.7.1.alpha0
Authors: Jeroen Demeyer Reviewers: John Cremona
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by jdemeyer)

The attached patch adds a logfile for the Dokchitser gp scripts. This is something that I personally needed while debugging some issues with a new PARI package (#11130).

Attachments (1)

11134_dokchitser.patch (2.0 KB) - added by jdemeyer 9 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 9 years ago by jdemeyer

  • Status changed from new to needs_review

comment:2 follow-ups: Changed 9 years ago by cremona

  • Status changed from needs_review to needs_info

Applies fine t. 4.7.alpha4 and all tests pass. But I am a little concerned that with the patch, a log file is created whether or not the user wants one. This differs from the standard pexpect convention that a log file may be requested but is not created by default.

Would it work to move the logfile parameter to the init function, with default None, and have that function start up the interpreter?

John

comment:3 in reply to: ↑ 2 Changed 9 years ago by jdemeyer

  • Description modified (diff)

Replying to cremona:

Applies fine t. 4.7.alpha4 and all tests pass. But I am a little concerned that with the patch, a log file is created whether or not the user wants one. This differs from the standard pexpect convention that a log file may be requested but is not created by default.

Let me just point out that gp (from PARI/GP) always logs by default (but this might be a bad thing too).

comment:4 in reply to: ↑ 2 Changed 9 years ago by jdemeyer

Replying to cremona:

Would it work to move the logfile parameter to the init function, with default None, and have that function start up the interpreter?

Not sure, because the Dokchitser stuff is often initialized indirectly.

I could live with the following:

logfile = None
# For debugging
#logfile = os.path.join(DOT_SAGE, 'dokchitser.log')
g = sage.interfaces.gp.Gp(script_subdirectory='dokchitser', logfile=logfile)

comment:5 follow-up: Changed 9 years ago by cremona

I had not noticed that gp always produces a logfile! I would vote to remove that and make it optional.

I prefer your "debugging" option. This may well need revisiting after we have put in the new-style Dokchitser interface as worked on by Henri Cohen and me and Martin Raum recently -- I ost track of where that got to.

comment:6 Changed 9 years ago by jdemeyer

  • Status changed from needs_info to needs_work

The best solution would be to have some kind of global "logging" option, similar to the "proof" option that we have currently in Sage. However, this is certainly a more complex solution and not high on my priority list.

Changed 9 years ago by jdemeyer

comment:7 in reply to: ↑ 5 Changed 9 years ago by jdemeyer

  • Milestone changed from sage-4.7 to sage-4.7.1
  • Reviewers set to John Cremona
  • Status changed from needs_work to needs_review

Replying to cremona:

I prefer your "debugging" option.

Done. I chose the simplest solution for this ticket, but you are right that there is work to be done concerning logging (but not on this ticket).

comment:8 follow-up: Changed 9 years ago by cremona

Looks fine, testing now...

comment:9 in reply to: ↑ 8 Changed 9 years ago by cremona

  • Status changed from needs_review to positive_review

Replying to cremona:

Looks fine, testing now...

... and all passed.

comment:10 Changed 9 years ago by jdemeyer

  • Merged in set to sage-4.7.1.alpha0
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.