OctoprintKlipperPlugin/octoprint_klipper/logger.py

34 lines
743 B
Python
Raw Normal View History

2021-11-21 00:16:23 +03:00
from octoprint_klipper import util
2021-09-05 16:28:57 +03:00
def log_info(self, message):
self._octoklipper_logger.info(message)
2021-10-07 00:14:57 +03:00
util.send_message(
self,
type = "log",
subtype = "info",
title = message,
payload = message
)
2021-09-05 16:28:57 +03:00
def log_debug(self, message):
self._octoklipper_logger.debug(message)
self._logger.info(message)
2021-10-07 00:14:57 +03:00
util.send_message(
self,
type = "console",
subtype = "debug",
title = message,
payload = message
)
2021-09-05 16:28:57 +03:00
def log_error(self, error):
self._octoklipper_logger.error(error)
self._logger.error(error)
2021-10-07 00:14:57 +03:00
util.send_message(
self,
type = "log",
subtype = "error",
title = error,
payload = error
)