Skip to content

Commit

Permalink
Moves log import.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrwils committed May 13, 2024
1 parent 9a7000f commit de3ffd5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions custom-plugins/my_first_plugin/protocols/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
from canvas_sdk.events import EventType
from canvas_sdk.protocols import BaseProtocol

from logger import log


class Protocol(BaseProtocol):
RESPONDS_TO = EventType.Name(EventType.ASSESS_COMMAND__CONDITION_SELECTED)

NARRATIVE_STRING = "monkey"

def compute(self):
log.info(self.NARRATIVE_STRING)
payload = {
"note": {"uuid": self.context["note"]["uuid"]},
"data": {"narrative": self.NARRATIVE_STRING},
Expand Down
2 changes: 2 additions & 0 deletions logger/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from logger.logger import PluginLogger
log = PluginLogger()
3 changes: 1 addition & 2 deletions plugin_runner/plugin_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@

from sandbox import Sandbox

from logger.logger import PluginLogger
log = PluginLogger()
from logger import log

ENV = os.getenv("ENV", "development")

Expand Down
1 change: 1 addition & 0 deletions plugin_runner/sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"hmac",
"http",
"json",
"logger",
"math",
"operator",
"pickletools",
Expand Down

0 comments on commit de3ffd5

Please sign in to comment.