Project

Profile

Help

Feature #6520

closed

Possible to capture messages and errors to a file?

Added by Eliot Kimber 4 months ago. Updated 16 days ago.

Status:
Resolved
Priority:
Low
Category:
-
Start date:
2024-08-29
Due date:
% Done:

100%

Estimated time:
Applies to branch:
12, trunk
Fix Committed on Branch:
12, trunk
Fixed in Maintenance Release:
Found in version:
Fixed in version:
SaxonC Languages:
All
SaxonC Platforms:
All
SaxonC Architecture:

Description

Using saxonche 12.5.0 from Python 3.10

I am trying to log Saxon message and error output to a file but it looks like I only get message output, with errors going to the console.

I'm using this code to configure the message handling:

executable.set_save_xsl_message(False, logger.get_log_file().as_posix());

Where my logger logs to a file.

I didn't see anything in the docs that suggested a way to also get the error output.

Is this possible?


Related issues

Related to SaxonC - Bug #6556: http://saxon.sf.net/feature/standardErrorOutputFile file is created but remains empty, errors are written to the console not the fileResolvedO'Neil Delpratt2024-10-02

Actions
Actions #1

Updated by O'Neil Delpratt 4 months ago

  • Status changed from New to AwaitingInfo

Hi Eliot,

I believe the design is to raise the errors as exceptions in python. Therefore errors can be caught with try-except block. If I have misunderstood your requirement or if something is not working as expected please let us know and maybe post a repo.

Actions #2

Updated by O'Neil Delpratt about 1 month ago

  • Related to Bug #6556: http://saxon.sf.net/feature/standardErrorOutputFile file is created but remains empty, errors are written to the console not the file added
Actions #3

Updated by Eliot Kimber about 1 month ago

O'Neil,

I'll look into the use of try/catch to capture errors--it's quite possible I simply misunderstood how best to handle errors.

The use of SaxonC in Python is not a priority for us at the moment but I'll keep this in mind when I return to it.

Actions #4

Updated by O'Neil Delpratt 28 days ago

  • Status changed from AwaitingInfo to In Progress
  • Assignee set to O'Neil Delpratt
Actions #5

Updated by O'Neil Delpratt 24 days ago

  • SaxonC Languages All added
  • SaxonC Languages deleted (Python)

Update: Internally SaxonC creates a Java Xslt30Transformer from the XsltExecutable. We catch exceptions on the transformer, but we also need to customise the ErrorReporter on the transformer to prevent outputting to the stderr. I have applied a fix for this which will be available in the next maintenance release.

Actions #6

Updated by O'Neil Delpratt 17 days ago

  • % Done changed from 0 to 90
  • Applies to branch 12, trunk added
  • Fix Committed on Branch 12, trunk added

Fix has been committed in the Processors for Xslt, XQuery and XPath.

Actions #7

Updated by O'Neil Delpratt 16 days ago

  • Status changed from In Progress to Resolved
  • % Done changed from 90 to 100

Added a further fix to make sure the handling of exceptions works in threads.

Please register to edit this issue

Also available in: Atom PDF