Created
August 15, 2020 15:19
-
-
Save seifip/4278daff35e620793abaa13c986a7feb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from robot.libraries.BuiltIn import BuiltIn | |
from Logger import log_to_bugsnag | |
class MyUtils: | |
def log_event(self, message, severity='info', **details): | |
"""Logs message to Bugsnag. | |
Args: | |
severity (str): Log severity (error, warning, info) | |
message (str): Log message | |
**details: Additiona details to be attached to the log | |
""" | |
current_order_id = BuiltIn().get_variable_value("${CURRENT_ORDER_ID}") | |
context = f"Order {current_order_id}" if current_order_id else "General" | |
log_to_bugsnag(message, severity, context, details) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment