Add services to start/stop debug logging (of integrations)

1st iteration (the past):

add logging in YAML

  default: info
    homeassistant.components.fritz: debug
    fritzconnection: debug

2nd iteration (current status):

start and stop debug logging for a specific integration in the UI

3rd iteration (feature request):

My proposal for the next step/3rd iteration:

Add services to start/stop debug logging. That way (the only way!) we can

  • automate debug logging using automations, e. g. based on events or at least time schedule triggers
  • restrict the debug logging to a sharp time interval and therefore only log what is needed, making it also easier to parse and check the log
service: homeassistant.start_debug_logging
data: {}
  integration: fritz
service: homeassistant.stop_debug_logging
data: {}
  integration: fritz

Current problem/motivation: