Skip to content

Commit

Permalink
Enable faulthandler to provide more fault information (#301)
Browse files Browse the repository at this point in the history
Enable faulthandler to provide more fault information.

#### Work item tracking
Microsoft ADO (number only): 17637258

**- What I did**
Enable faulthandler to provide more fault information.

**- How I did it**
Enable faulthandler when snmp-subagent startup.

**- How to verify it**
Pass all UT

**- Description for the changelog**
Enable faulthandler to provide more fault information.
  • Loading branch information
liuh-80 authored and mssonicbld committed Dec 15, 2023
1 parent 57ee4b9 commit f9849f0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/sonic_ax_impl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import json
import logging.handlers

import faulthandler

# configure logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
logger.addHandler(logging.NullHandler())

# enable faulthandler to provide more information for debug
# after enable faulthandler, the file 'stderr' will be remembered by faulthandler:
# https://docs.python.org/dev/library/faulthandler.html#issue-with-file-descriptors
faulthandler.enable()

0 comments on commit f9849f0

Please sign in to comment.