Honor an explicit --loglevel info when INFO is already the level

ZE
4h ago
+106-0

Part of #7850 (the --loglevel half; #7947 handles export()).

set_log_level() only writes REFLEX_LOGLEVEL when the level changes, and it starts at INFO, so an explicit --loglevel info never reached the config and could be overridden by rxconfig.py or export_for_deploy().

This updates both --loglevel callbacks to write an explicit level to REFLEX_LOGLEVEL and adds unit tests. set_log_level() is left unchanged since hosting commands call it with a default "info" even without a flag, which would otherwise override rxconfig.py.

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

  • Bug fix (non-breaking change which fixes an issue)