Skip to content

Commit

Permalink
Merge pull request automatic-ripping-machine#1154 from microtechno900…
Browse files Browse the repository at this point in the history
…0/bugfix_1150

[BUGFIX] - Fix to Flask logging to align with arm.yml config
  • Loading branch information
shitwolfymakes authored Jun 30, 2024
2 parents 04d2841 + 81c0771 commit 0b3e515
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.1
2.7.2
5 changes: 5 additions & 0 deletions arm/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
login_manager = LoginManager()
login_manager.init_app(app)

# Set log level per arm.yml config
app.logger.info(f"Setting log level to: {cfg.arm_config['LOGLEVEL']}")
app.logger.setLevel(cfg.arm_config['LOGLEVEL'])

# Set Flask database connection configurations
app.config['SQLALCHEMY_DATABASE_URI'] = sqlitefile
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
# We should really generate a key for each system
Expand Down
4 changes: 4 additions & 0 deletions arm/ui/settings/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ def save_settings():
settings_file.close()
success = True
importlib.reload(cfg)
# Set the ARM Log level to the config
app.logger.info(f"Setting log level to: {cfg.arm_config['LOGLEVEL']}")
app.logger.setLevel(cfg.arm_config['LOGLEVEL'])

# If we get to here there was no post data
return {'success': success, 'settings': cfg.arm_config, 'form': 'arm ripper settings'}

Expand Down

0 comments on commit 0b3e515

Please sign in to comment.