Skip to content

Commit

Permalink
Modified scripts: replaced deprecated 'logger' with 'syslogger' (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
assrinivasan authored and mssonicbld committed Aug 24, 2024
1 parent 81a4ee8 commit 0782d4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions scripts/determine-reboot-cause
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ try:
import re
import sys

from sonic_py_common import device_info, logger
from sonic_py_common import device_info, syslogger

except ImportError as err:
raise ImportError("%s - required module not found" % str(err))
Expand Down Expand Up @@ -44,7 +44,7 @@ REBOOT_CAUSE_NON_HARDWARE = "Non-Hardware"
REBOOT_CAUSE_HARDWARE_OTHER = "Hardware - Other"

# Global logger class instance
sonic_logger = logger.Logger(SYSLOG_IDENTIFIER)
sonic_logger = syslogger.SysLogger(SYSLOG_IDENTIFIER)


# ============================= Functions =============================
Expand Down Expand Up @@ -210,7 +210,7 @@ def determine_reboot_cause():

def main():
# Configure logger to log all messages INFO level and higher
sonic_logger.set_min_log_priority_info()
sonic_logger.set_min_log_priority(sonic_logger.DEFAULT_LOG_LEVEL)

sonic_logger.log_info("Starting up...")

Expand Down
6 changes: 3 additions & 3 deletions scripts/process-reboot-cause
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ try:
import sys

from swsscommon import swsscommon
from sonic_py_common import logger
from sonic_py_common import syslogger
except ImportError as err:
raise ImportError("%s - required module not found" % str(err))

Expand All @@ -33,7 +33,7 @@ REDIS_HOSTIP = "127.0.0.1"
state_db = None

# Global logger class instance
sonic_logger = logger.Logger(SYSLOG_IDENTIFIER)
sonic_logger = syslogger.SysLogger(SYSLOG_IDENTIFIER)


# ============================= Functions =============================
Expand Down Expand Up @@ -72,7 +72,7 @@ def read_reboot_cause_files_and_save_state_db():

def main():
# Configure logger to log all messages INFO level and higher
sonic_logger.set_min_log_priority_info()
sonic_logger.set_min_log_priority(sonic_logger.DEFAULT_LOG_LEVEL)

sonic_logger.log_info("Starting up...")

Expand Down

0 comments on commit 0782d4c

Please sign in to comment.