
    kh                     X    d dl Z d dlmZ d dlmZ  ed          Z G d de          ZdS )    N)BaseCommand)	getLoggerzdjango.commandsc                   "     e Zd ZdZ fdZ xZS )LoggingBaseCommanda  
    A subclass of BaseCommand that logs run time errors to `django.commands`.
    To use this, create a management command subclassing LoggingBaseCommand:

        from django_extensions.management.base import LoggingBaseCommand

        class Command(LoggingBaseCommand):
            help = 'Test error'

            def handle(self, *args, **options):
                raise Exception


    And then define a logging handler in settings.py:

        LOGGING = {
            ... # Other stuff here

            'handlers': {
                'mail_admins': {
                    'level': 'ERROR',
                    'filters': ['require_debug_false'],
                    'class': 'django.utils.log.AdminEmailHandler'
                },
            },
            'loggers': {
                'django.commands': {
                    'handlers': ['mail_admins'],
                    'level': 'ERROR',
                    'propagate': False,
                },
            }

        }

    c                     	  t                      j        |i | d S # t          $ r6}t                              |t          j                    ddi            d }~ww xY w)Nstatus_codei  )exc_infoextra)superexecute	Exceptionloggererrorsysr	   )selfargsoptionse	__class__s       X/var/www/histauto/venv/lib/python3.11/site-packages/django_extensions/management/base.pyr   zLoggingBaseCommand.execute0   sn    	EGGOT-W----- 	 	 	LLS\^^M3;OLPPP	s    
A1AA)__name__
__module____qualname____doc__r   __classcell__)r   s   @r   r   r   
   sC        # #J            r   )r   django.core.management.baser   loggingr   r   r    r   r   <module>r       sv    



 3 3 3 3 3 3      	$	%	%+ + + + + + + + + +r   