moonraker: rename deprecated "logging.warn"

Python uses "logging.warning" to log warning level methods.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2021-05-23 14:26:22 -04:00
parent dc4da6087f
commit 60d6c748ef
2 changed files with 2 additions and 2 deletions

View File

@ -328,7 +328,7 @@ class CommandHelper:
self.server = config.get_server()
self.debug_enabled = config.getboolean('enable_repo_debug', False)
if self.debug_enabled:
logging.warn("UPDATE MANAGER: REPO DEBUG ENABLED")
logging.warning("UPDATE MANAGER: REPO DEBUG ENABLED")
shell_cmd: SCMDComp = self.server.lookup_component('shell_command')
self.scmd_error = shell_cmd.error
self.build_shell_command = shell_cmd.build_shell_command

View File

@ -161,7 +161,7 @@ class Server:
def add_warning(self, warning: str, log: bool = True) -> None:
self.warnings.append(warning)
if log:
logging.warn(warning)
logging.warning(warning)
# ***** Component Management *****
def _load_components(self, config: confighelper.ConfigHelper) -> None: