From 4fcd72fd1b17ce9df4db279507ccd47328f03925 Mon Sep 17 00:00:00 2001 From: TrainDoctor Date: Wed, 24 Aug 2022 18:06:26 -0700 Subject: [PATCH] Added basic logging config --- main.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 9bd4dab..60ac607 100644 --- a/main.py +++ b/main.py @@ -1,9 +1,18 @@ +import logging + +logging.basicConfig(filename="/tmp/template.log", + format='[Template] %(asctime)s %(levelname)s %(message)s', + filemode='w+', + force=True) +logger=logging.getLogger() +logger.setLevel(logging.INFO) # can be changed to logging.DEBUG for debugging issues + class Plugin: # A normal method. It can be called from JavaScript using call_plugin_function("method_1", argument1, argument2) async def add(self, left, right): return left + right - # Asyncio-compatible long-running code, executed in a task when the plugin is loaded async def _main(self): + logger.info("Hello World!") pass