from collections.abc import Generatorfrom typing import Anyfrom dify_plugin import Toolfrom dify_plugin.entities.tool import ToolInvokeMessage# Import logging and custom handlerimport loggingfrom dify_plugin.config.logger_format import plugin_logger_handler# Set up logging with the custom handlerlogger = logging.getLogger(__name__)logger.setLevel(logging.INFO)logger.addHandler(plugin_logger_handler)class LoggerDemoTool(Tool): def _invoke(self, tool_parameters: dict[str, Any]) -> Generator[ToolInvokeMessage]: # Log messages with different severity levels logger.info("This is a INFO log message.") logger.warning("This is a WARNING log message.") logger.error("This is a ERROR log message.") yield self.create_text_message("Hello, Dify!")