diff --git a/src/octoprint/cli/server.py b/src/octoprint/cli/server.py index ab9ea5fe4..5a28741a9 100644 --- a/src/octoprint/cli/server.py +++ b/src/octoprint/cli/server.py @@ -50,12 +50,12 @@ def run_server(basedir, configfile, host, port, v6_only, debug, allow_root, logg from octoprint import urllib3_ssl if not urllib3_ssl: logging.getLogger("octoprint.server")\ - .warn("requests/urllib3 will run in an insecure SSL environment. " - "You might see corresponding warnings logged later " - "(\"InsecurePlatformWarning\"). It is recommended to either " - "update to a Python version >= 2.7.9 or alternatively " - "install PyOpenSSL plus its dependencies. For details see " - "https://urllib3.readthedocs.org/en/latest/security.html#openssl-pyopenssl") + .warning("requests/urllib3 will run in an insecure SSL environment. " + "You might see corresponding warnings logged later " + "(\"InsecurePlatformWarning\"). It is recommended to either " + "update to a Python version >= 2.7.9 or alternatively " + "install PyOpenSSL plus its dependencies. For details see " + "https://urllib3.readthedocs.org/en/latest/security.html#openssl-pyopenssl") logger.info(get_divider_line("*")) def log_register_rollover(safe_mode=None, plugin_manager=None, environment_detector=None, **kwargs): diff --git a/src/octoprint/plugins/backup/__init__.py b/src/octoprint/plugins/backup/__init__.py index ba2340fe5..c0bd77866 100644 --- a/src/octoprint/plugins/backup/__init__.py +++ b/src/octoprint/plugins/backup/__init__.py @@ -252,14 +252,14 @@ class BackupPlugin(octoprint.plugin.SettingsPlugin, compatible = octoprint_compatible and os_compatible if not compatible: if not octoprint_compatible and not os_compatible: - self._logger.warn("Cannot install plugin {}, it is incompatible to this version " - "of OctoPrint and the underlying operating system".format(plugin["id"])) + self._logger.warning("Cannot install plugin {}, it is incompatible to this version " + "of OctoPrint and the underlying operating system".format(plugin["id"])) elif not octoprint_compatible: - self._logger.warn("Cannot install plugin {}, it is incompatible to this version " - "of OctoPrint".format(plugin["id"])) + self._logger.warning("Cannot install plugin {}, it is incompatible to this version " + "of OctoPrint".format(plugin["id"])) elif not os_compatible: - self._logger.warn("Cannot install plugin {}, it is incompatible to the underlying " - "operating system".format(plugin["id"])) + self._logger.warning("Cannot install plugin {}, it is incompatible to the underlying " + "operating system".format(plugin["id"])) self._send_client_message("plugin_incompatible", dict(plugin=plugin["id"], octoprint_compatible=octoprint_compatible, os_compatible=os_compatible)) diff --git a/src/octoprint/plugins/pluginmanager/__init__.py b/src/octoprint/plugins/pluginmanager/__init__.py index 66bb9fde0..b19dfd218 100644 --- a/src/octoprint/plugins/pluginmanager/__init__.py +++ b/src/octoprint/plugins/pluginmanager/__init__.py @@ -193,7 +193,7 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin, if helpers and "get_throttled" in helpers: self._get_throttled = helpers["get_throttled"] if self._settings.get_boolean(["ignore_throttled"]): - self._logger.warn("!!! THROTTLE STATE IGNORED !!! You have configured the Plugin Manager plugin to ignore an active throttle state of the underlying system. You might run into stability issues or outright corrupt your install. Consider fixing the throttling issue instead of suppressing it.") + self._logger.warning("!!! THROTTLE STATE IGNORED !!! You have configured the Plugin Manager plugin to ignore an active throttle state of the underlying system. You might run into stability issues or outright corrupt your install. Consider fixing the throttling issue instead of suppressing it.") # decouple repository fetching from server startup self._fetch_all_data(do_async=True) @@ -1121,7 +1121,7 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin, # validation if not isinstance(repo_data, (list, tuple)): - self._logger.warn("Invalid repository data: expected a list, got {!r}".format(repo_data)) + self._logger.warning("Invalid repository data: expected a list, got {!r}".format(repo_data)) return None try: diff --git a/src/octoprint/plugins/softwareupdate/__init__.py b/src/octoprint/plugins/softwareupdate/__init__.py index debb9bd0d..87c1909ca 100644 --- a/src/octoprint/plugins/softwareupdate/__init__.py +++ b/src/octoprint/plugins/softwareupdate/__init__.py @@ -132,7 +132,7 @@ class SoftwareUpdatePlugin(octoprint.plugin.BlueprintPlugin, if helpers and "get_throttled" in helpers: self._get_throttled = helpers["get_throttled"] if self._settings.get_boolean(["ignore_throttled"]): - self._logger.warn("!!! THROTTLE STATE IGNORED !!! You have configured the Software Update plugin to ignore an active throttle state of the underlying system. You might run into stability issues or outright corrupt your install. Consider fixing the throttling issue instead of suppressing it.") + self._logger.warning("!!! THROTTLE STATE IGNORED !!! You have configured the Software Update plugin to ignore an active throttle state of the underlying system. You might run into stability issues or outright corrupt your install. Consider fixing the throttling issue instead of suppressing it.") def on_after_startup(self): self._check_environment() diff --git a/src/octoprint/server/__init__.py b/src/octoprint/server/__init__.py index d8863b7dd..98ced21e0 100644 --- a/src/octoprint/server/__init__.py +++ b/src/octoprint/server/__init__.py @@ -1987,7 +1987,7 @@ class Server(object): continue if not key_whitelist.match(p["key"]): - self._logger.warn("Got permission with invalid key from plugin {}: {}".format(name, p["key"])) + self._logger.warning("Got permission with invalid key from plugin {}: {}".format(name, p["key"])) continue if not process_regular_permission(plugin_info, p): diff --git a/src/octoprint/server/api/system.py b/src/octoprint/server/api/system.py index 411b67ce9..43a165992 100644 --- a/src/octoprint/server/api/system.py +++ b/src/octoprint/server/api/system.py @@ -42,7 +42,7 @@ def _usageForFolders(): @no_firstrun_access @Permissions.SYSTEM.require(403) def performSystemAction(): - logging.getLogger(__name__).warn("Deprecated API call to /api/system made by {}, should be migrated to use /system/commands/custom/".format(get_remote_address(request))) + logging.getLogger(__name__).warning("Deprecated API call to /api/system made by {}, should be migrated to use /system/commands/custom/".format(get_remote_address(request))) data = request.get_json(silent=True) if data is None: @@ -213,7 +213,7 @@ def _get_core_command_specs(): def _get_core_command_spec(action): available_actions = _get_core_command_specs() if not action in available_actions: - logging.getLogger(__name__).warn(u"Command for core action {} is not configured, you need to configure the command before it can be used".format(action)) + logging.getLogger(__name__).warning(u"Command for core action {} is not configured, you need to configure the command before it can be used".format(action)) return None return available_actions[action] diff --git a/src/octoprint/server/util/flask.py b/src/octoprint/server/util/flask.py index 6cfbf552f..7c79c32b0 100644 --- a/src/octoprint/server/util/flask.py +++ b/src/octoprint/server/util/flask.py @@ -891,7 +891,7 @@ class PreemptiveCache(object): cache_data = dict() if not self._validate_data(cache_data): - self._logger.warn("Preemptive cache data was invalid, ignoring it") + self._logger.warning("Preemptive cache data was invalid, ignoring it") cache_data = dict() return cache_data diff --git a/src/octoprint/server/util/sockjs.py b/src/octoprint/server/util/sockjs.py index a35b11349..5f019ada1 100644 --- a/src/octoprint/server/util/sockjs.py +++ b/src/octoprint/server/util/sockjs.py @@ -209,7 +209,7 @@ class PrinterStateConnection(octoprint.vendor.sockjs.tornado.SockJSConnection, user = self._userManager.find_user(userid=user_id, session=user_session) self._on_login(user) else: - self._logger.warn("Unknown user/session combo: {}:{}".format(user_id, user_session)) + self._logger.warning("Unknown user/session combo: {}:{}".format(user_id, user_session)) self._on_logout() self._register() diff --git a/src/octoprint/server/util/tornado.py b/src/octoprint/server/util/tornado.py index a7b15be97..9baf3c2d2 100644 --- a/src/octoprint/server/util/tornado.py +++ b/src/octoprint/server/util/tornado.py @@ -1015,8 +1015,8 @@ class LargeResponseHandler(RequestlessExceptionLoggingMixin, self.set_header("Content-Encoding", "gzip") path = path + ".gz" else: - logging.getLogger(__name__).warn("Precompressed assets expected but {}.gz does not exist " - "in {}, using plain file instead.".format(path, self.root)) + logging.getLogger(__name__).warning("Precompressed assets expected but {}.gz does not exist " + "in {}, using plain file instead.".format(path, self.root)) return tornado.web.StaticFileHandler.get(self, path, include_body=include_body) diff --git a/src/octoprint/server/views.py b/src/octoprint/server/views.py index 15895a83f..3883957de 100644 --- a/src/octoprint/server/views.py +++ b/src/octoprint/server/views.py @@ -182,9 +182,9 @@ def index(): request_refresh = "_refresh" in request.values printing = printer.is_printing() if client_refresh and printing: - logging.getLogger(__name__).warn("Client requested cache refresh via cache-control headers but we are printing. " - "Not invalidating caches due to resource limitation. Append ?_refresh=true to " - "the URL if you absolutely require a refresh now") + logging.getLogger(__name__).warning("Client requested cache refresh via cache-control headers but we are printing. " + "Not invalidating caches due to resource limitation. Append ?_refresh=true to " + "the URL if you absolutely require a refresh now") client_refresh = client_refresh and not printing force_refresh = client_refresh \ or request_refresh \ diff --git a/src/octoprint/timelapse.py b/src/octoprint/timelapse.py index f38484f50..18af23279 100644 --- a/src/octoprint/timelapse.py +++ b/src/octoprint/timelapse.py @@ -351,8 +351,8 @@ def configure_timelapse(config=None, persist=False): type = config["type"] if not timelapse_precondition and timelapse_precondition: - logging.getLogger(__name__).warn("Essential timelapse settings unconfigured (snapshot URL or FFMPEG path) " - "but timelapse enabled.") + logging.getLogger(__name__).warning("Essential timelapse settings unconfigured (snapshot URL or FFMPEG path) " + "but timelapse enabled.") if not timelapse_enabled or not timelapse_precondition or type is None or "off" == type: current = None @@ -918,7 +918,7 @@ class TimelapseRenderJob(object): if os.path.exists(temporary): os.remove(temporary) except Exception: - self._logger.warn("Could not delete temporary timelapse {}".format(temporary)) + self._logger.warning("Could not delete temporary timelapse {}".format(temporary)) self._notify_callback("always", output) def _process_ffmpeg_output(self, *lines): diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 03eacc16c..e24d5c327 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -3043,7 +3043,7 @@ class MachineCom(object): # printer keeps requesting the same line again and again, something is severely broken here error_text = "Printer keeps requesting line {} again and again, communication stuck".format(lineToResend) self._log(error_text) - self._logger.warn(error_text) + self._logger.warning(error_text) self._trigger_error(error_text, "resend_loop") else: self._currentConsecutiveResendNumber = lineToResend @@ -4531,7 +4531,7 @@ def convert_feedback_controls(configured_controls): result[key]["matcher"] = re.compile(control["regex"]) result[key]["pattern"] = control["regex"] except Exception as exc: - _logger.warn("Invalid regex {regex} for custom control: {exc}".format(regex=control["regex"], exc=str(exc))) + _logger.warning("Invalid regex {regex} for custom control: {exc}".format(regex=control["regex"], exc=str(exc))) result[key]["templates"][control["template_key"]] = control["template"]