♻ logger.warn => logger.warning
`warn` is deprecated
This commit is contained in:
1 parent
0461992496
commit
eac45562f8
12 files changed
+30
-30
No files matched your search
@@ -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):
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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/<action>".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/<action>".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]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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"]
|
||||
|
||||
|
||||
Reference in new issue
Block a user