Skip to content

Instantly share code, notes, and snippets.

@seifip
Created August 15, 2020 15:19
Show Gist options
  • Save seifip/4278daff35e620793abaa13c986a7feb to your computer and use it in GitHub Desktop.
Save seifip/4278daff35e620793abaa13c986a7feb to your computer and use it in GitHub Desktop.
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