__init__.py 544 B

1234567891011121314151617181920212223
  1. # Copyright (c) 2019 Ultimaker B.V.
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. from typing import TYPE_CHECKING, Dict, Any
  4. try:
  5. import sentry_sdk
  6. has_sentry = True
  7. except ImportError:
  8. has_sentry = False
  9. from . import SentryLogger
  10. if TYPE_CHECKING:
  11. from UM.Application import Application
  12. def getMetaData() -> Dict[str, Any]:
  13. return {}
  14. def register(app: "Application") -> Dict[str, Any]:
  15. if not has_sentry:
  16. return {} # Nothing to do here!
  17. return {"logger": SentryLogger.SentryLogger()}