Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading the XML messages in a VEN #131

Open
juantxorena opened this issue Nov 4, 2022 · 4 comments
Open

Reading the XML messages in a VEN #131

juantxorena opened this issue Nov 4, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@juantxorena
Copy link

Hello,

I'm trying to get the actual raw XML messages received (and sent) by a VEN, e.g. the events. I would like to save them somewhere for logging and debugging purposes. It looks like they are parsed and mapped in the client just as they are received, and I cannot access them in any way.

I've seen this old bug about hooks, but it seems it's only implemented in the VTN, not in the VEN. I also tried something with middlewares and hooks in aiohttp, but with no success. I'm quite inexperienced with python, so maybe I'm doing something wrong.

So, the question is, barring copying the whole openleadr locally and implementing what I need (which is obviously not ideal), is there any way of getting the messages before parsing in a VEN?

Thanks in advance.

@stan-janssen
Copy link
Member

The XML messages are logged at the 'debug' level, which you can use to inspect the message.

I can look into adding a possible hook in the client that will allow you to add a handler before schema validation and parsing.

stan-janssen added a commit that referenced this issue Nov 23, 2022
stan-janssen added a commit that referenced this issue Nov 23, 2022
stan-janssen added a commit that referenced this issue Nov 23, 2022
@stan-janssen
Copy link
Member

I've added a simple hooks infrastructure where you'll get the raw XML messages delivered to a handler that you can register. See the documentation for more info. Let me know if this is helpful.

@stan-janssen
Copy link
Member

@juantxorena; did you get a chance to try this addition to OpenLEADR?

@axmsoftware axmsoftware added the enhancement New feature or request label Aug 6, 2024
@axmsoftware
Copy link
Contributor

@stan-janssen do you plan to submit a PR for this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants