def run(): # Logging log_file = os.path.join(pm.moduleInfo(mn="ColorOut", p=1), "ColorOut.log") # type:str Logger.write_to_rotating_file(log_file) Logger.info("Logging to file: {0}".format(log_file)) syntax.HighlightManager.create_connection() Logger.info("Applied stdout highlighting") menuItem.ColorOutItem.save_add_scriptJob()
def create(cls): cls.delete_old() try: pm.menuItem(cls.ITEM_OBJECT, l=cls.ITEM_LABEL, parent=cls.WINDOW_MENU, i="colorProfile.svg", ia="wmNodeEditor", c=settingsDialog.Dialog.display) Logger.info("Created menuItem: Windows>ColorOut") except Exception: Logger.exception("Error when creating menu item")
from ColorOut.loggingFn import Logger Logger.info("Test info") Logger.debug("Test debug") Logger.error("Test error") Logger.warning("Test warning") Logger.critical("Test critical") Logger.log(5, "Log message") # try: # a = [] # b = a[0] # except BaseException: # Logger.exception("Exception message")