moonraker: Add some additional logging during init

This logging may be useful in helping users troubleshoot problems stemming from Klippy based errors.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2020-07-31 12:49:25 -04:00
parent 1e018e9b92
commit 2ae4034b97
1 changed files with 10 additions and 0 deletions

View File

@ -241,6 +241,11 @@ class Server:
if not isinstance(result, ServerError): if not isinstance(result, ServerError):
self._load_config(result) self._load_config(result)
self.server_configured = True self.server_configured = True
else:
logging.info(
"\nError receiving configuration. This indicates a potential\n"
"configuration issue in printer.cfg. Please check klippy.log\n"
"for more information")
async def _request_ready(self): async def _request_ready(self):
request = self.make_request( request = self.make_request(
@ -250,6 +255,11 @@ class Server:
is_ready = result.get("is_ready", False) is_ready = result.get("is_ready", False)
if is_ready: if is_ready:
self._set_klippy_ready() self._set_klippy_ready()
if not self.is_klippy_ready:
logging.info(
"\nKlippy not ready. This indicates a that Klippy may have\n"
"experienced an error during startup. Please check\n"
"klippy.log for more information")
def _load_config(self, config): def _load_config(self, config):
self.request_timeout = config.get( self.request_timeout = config.get(