* dev: pages migrations * dev: page models * dev: api migrations * chore: apis for pages migrations * chore: dropped project id from page label and logs * dev: pages logger exception --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com> Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
23 lines
445 B
Python
23 lines
445 B
Python
# Python imports
|
|
import logging
|
|
import traceback
|
|
|
|
# Django imports
|
|
from django.conf import settings
|
|
|
|
# Third party imports
|
|
from sentry_sdk import capture_exception
|
|
|
|
|
|
def log_exception(e):
|
|
# Log the error
|
|
logger = logging.getLogger("plane")
|
|
logger.error(e)
|
|
|
|
if settings.DEBUG:
|
|
# Print the traceback if in debug mode
|
|
traceback.print_exc(e)
|
|
|
|
# Capture in sentry if configured
|
|
capture_exception(e)
|
|
return
|