Commit 5f9b368e by Oleksandr Barabash

additional logs added

parent cd77923c
""" Message extension bot """
import asyncio
import logging
import sys
import time
import uuid
......@@ -32,6 +33,7 @@ from utils.functions import get_i18n
from utils.log import Log
log = logging.getLogger()
TAG = __name__
......@@ -246,10 +248,12 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
async def handle_submit_action(self, turn_context: TurnContext) -> None:
""" Handle card submit action """
log.info("executing handle_submit_action")
i18n = get_i18n(turn_context)
mx = self.get_mx(turn_context)
if mx.type == MXTypes.ACKNOWLEDGE:
log.info("submit action is mx type")
try:
account = turn_context.activity.from_property
ack_objects = await self.cosmos_client.get_acknowledge_items(
......@@ -276,6 +280,7 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
# DO NOTHING, Notification not found!
pass
return
log.info("unsupported submit type")
await turn_context.send_activity(i18n.t("unknown_request"))
async def on_message_activity(self, turn_context: TurnContext) -> None:
......@@ -293,6 +298,7 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
)
if turn_context.activity.value is not None:
log.info("activity.value is not none, handling submit action")
return await self.handle_submit_action(turn_context)
""" DATA STRUCTURE:
......
......@@ -6,8 +6,9 @@ import logging
def init_logging(filename=None, level=None):
""" init logging on the app level """
logging_config = {"format": "%(asctime)-23s %(levelname)8s::%(filename)s::"
"%(funcName)s: %(message)s",
logging_config = {"format": "%(asctime)-23s %(levelname)8s::"
"%(name)s::%(funcName)s:"
"%(message)s",
"level": level or logging.DEBUG}
if filename is not None:
logging_config["filename"] = filename
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment