core icon indicating copy to clipboard operation
core copied to clipboard

Add websocket endpoints to control integration logging

Open bdraco opened this issue 2 years ago • 10 comments

Proposed change

Frontend: https://github.com/home-assistant/frontend/pull/14319

Type of change

  • [ ] Dependency upgrade
  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [ ] New integration (thank you!)
  • [x] New feature (which adds functionality to an existing integration)
  • [ ] Breaking change (fix/feature causing existing functionality to break)
  • [ ] Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • [ ] The code change is tested and works locally.
  • [ ] Local tests pass. Your PR cannot be merged unless tests pass
  • [ ] There is no commented out code in this PR.
  • [ ] I have followed the development checklist
  • [ ] The code has been formatted using Black (black --fast homeassistant tests)
  • [ ] Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • [ ] The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • [ ] New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • [ ] Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • [ ] No score or internal
  • [ ] 🥈 Silver
  • [ ] 🥇 Gold
  • [ ] 🏆 Platinum

To help with the load of incoming pull requests:

bdraco avatar Jan 29 '22 00:01 bdraco

Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration (websocket_api) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration (logger) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

Sorry for my 180, but I actually think that this PR is going in the right direction. I would keep the commands in the logger integration and also store there if an integration is being logged.

balloob avatar Feb 08 '22 00:02 balloob

No worries, I haven't made much progress here. This one requires some uninterrupted thought which I haven't been able to give it as I've been tasking switching too much this last week. Hopefully I'll get a calm weekend. 🤷‍♂️

bdraco avatar Feb 08 '22 02:02 bdraco

I plan on working on this again next week when I'm not in Texas and have less distractions

bdraco avatar Feb 14 '22 15:02 bdraco

From discussion with Erik so I don't forget later: About the persistence of log settings and source of truth, I think we can just let the spammiest setting win?

bdraco avatar May 12 '22 13:05 bdraco

Commit 270f5cb adds support for persistent store of logger settings. Persistence can be set to one of "none", "once" or "permanent":

  • "none" the log override disappears at the next restart
  • "once" the log override survives one restart, and is then removed
  • "permanent" the log override is permanent

Also, if yaml and WS API log levels are in conflict, the spammiest level wins.

emontnemery avatar May 16 '22 18:05 emontnemery

Changes LGTM. I'll do some testing in a bit

bdraco avatar May 17 '22 13:05 bdraco

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.

github-actions[bot] avatar Aug 24 '22 04:08 github-actions[bot]

still relevant

bdraco avatar Aug 24 '22 05:08 bdraco