Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Add an endpoint to write DEBUG level logs #1209

Merged
merged 8 commits into from
Apr 4, 2024
Merged

Conversation

d-perl
Copy link
Contributor

@d-perl d-perl commented Mar 1, 2024

Fixes #1201, fixes #1208

To test:

  1. Run dev hyperion and execute: curl -X PUT http://127.0.0.1:5005/flush_debug_log and see that this works
  2. Check readme changes make sense

Copy link
Collaborator

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, works as expected some minor things, take them or leave them.

Could: If I delete the hyperion.log debug file then call the flush it doesn't make a new one, I think this is an edge case though so up to you if you want to address it.

Could: Ideally I think exposing the handlers out of log.py is a bit messy and would rather just expose a flush_debug function but I like that we return the filename in the status so maybe flush_debug should return the filename it flushes too? Not sure, up to you if you think it's cleaner or not

__logger_handlers = handlers


def get_memory_handler() -> CircularMemoryHandler:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think get_debug_handler would be slightly clearer as it's logging the debug not the memory

@d-perl d-perl merged commit 34e404b into main Apr 4, 2024
4 checks passed
@d-perl d-perl deleted the 1201_dump_debug_logs_endpoint branch April 4, 2024 10:36
olliesilvester pushed a commit to olliesilvester/mx-bluesky that referenced this pull request Aug 23, 2024
…Source/1201_dump_debug_logs_endpoint

Add an endpoint to write `DEBUG` level logs
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Readme is out of date and wrong Provide endpoint to flush debug logs
2 participants