Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
CORTX-33030: Set default log level to INFO (#2155)
Browse files Browse the repository at this point in the history
Problem:
As of now, much of the default logging in HARE is at DEBUG level. Its
recommended to use INFO as default log level, to generate just good enough logs
in production releases, and enable DEBUG log level only in development
systems. This enable system to more relevant logs in less number of lines and
hence size.

Solution:
Convert the DEBUG level of such logging to INFO level.

Signed-off-by: pavankrishnat <pavan.k.thunuguntla@seagate.com>

Signed-off-by: pavankrishnat <pavan.k.thunuguntla@seagate.com>
  • Loading branch information
pavankrishnat authored Aug 26, 2022
1 parent 96abb23 commit bd943b6
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 89 deletions.
8 changes: 4 additions & 4 deletions hax/hax/bytecount.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _get_pver_with_pver_status(self,
pver_info: PverInfo = motr.get_pver_status(
Fid.parse(p_ver))
pver_items[p_ver] = pver_info
LOG.debug('Received pool version and status: %s', pver_items)
LOG.info('Received pool version and status: %s', pver_items)
return pver_items

def _calculate_bc_per_pver(
Expand Down Expand Up @@ -105,13 +105,13 @@ def _calculate_bc_per_pver(
else:
pver_bc[pver_fid] = byte_count

LOG.debug('Bytecount with parity buffer: %s', pver_bc)
LOG.info('Bytecount with parity buffer: %s', pver_bc)

bc_without_parity: Dict[str, int] = {}
for pver, bc in pver_bc.items():
bc_without_parity[pver] = \
bc - self._get_parity_buffers(bc, pver_state[pver])
LOG.debug('Bytecount without parity buffer: %s', bc_without_parity)
LOG.info('Bytecount without parity buffer: %s', bc_without_parity)
return bc_without_parity

def _get_parity_buffers(self, bc: int, state: PverInfo) -> int:
Expand Down Expand Up @@ -140,7 +140,7 @@ def _execute(self, motr: Motr):
if status == ObjHealth.OK:
byte_count: ByteCountStats = \
motr.get_proc_bytecount(ios)
LOG.debug('Received bytecount: %s', byte_count)
LOG.info('Received bytecount: %s', byte_count)
if not byte_count:
continue
self.consul.update_pver_bc(byte_count)
Expand Down
10 changes: 5 additions & 5 deletions hax/hax/filestats.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ def _execute(self, motr: Motr):
stats = motr.get_filesystem_stats()
if not stats:
continue
LOG.debug('FS stats are as follows: %s', stats)
LOG.info('FS stats are as follows: %s', stats)
now_time = datetime.datetime.now()
data = FsStatsWithTime(stats=stats,
timestamp=now_time.timestamp(),
date=now_time.isoformat())
try:
self.consul.update_fs_stats(data)
except HAConsistencyException:
LOG.debug('Failed to update Consul KV '
'due to an intermittent error. The '
'error is swallowed since new attempts '
'will be made timely')
LOG.info('Failed to update Consul KV '
'due to an intermittent error. The '
'error is swallowed since new attempts '
'will be made timely')
wait_for_event(self.event, self.interval_sec)
except InterruptedException:
# No op. _sleep() has interrupted before the timeout exceeded:
Expand Down
2 changes: 1 addition & 1 deletion hax/hax/ha/message_type/message_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self):
logging.debug('Inside HealthMessage')

def send(self, event, util: ConsulUtil):
logging.debug('Sending HealthMessage: %s', event)
logging.info('Sending HealthMessage: %s', event)
for interface in self.topic_list.items():
sender = interface[1](util)
message_type = interface[0]
Expand Down
2 changes: 1 addition & 1 deletion hax/hax/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def update_process_failure(self, planner: WorkPlanner, motr: Motr,
# Check if process node is online
proc_node_status: ObjHealth = (
cns.get_proc_node_health(state.fid))
LOG.debug('Process node status: %s', proc_node_status)
LOG.info('Process node status: %s', proc_node_status)
# If process node is online, we assume corresponding
# hax is also online. Let the local hax process it.
if proc_node_status == ObjHealth.OK:
Expand Down
8 changes: 4 additions & 4 deletions hax/hax/hax.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,16 @@ def _remove_stale_session(util: ConsulUtil) -> None:
if util.is_leader_value_present_for_session():
node = util.get_leader_node()
if re.match(r'^elect[\d]+$', node):
LOG.debug(
LOG.info(
'Stale leader session found: RC leader session %s is '
'found while the leader node seems to be '
'stub: %s', sess, node)
util.destroy_session(sess)
LOG.debug('Stale session %s destroyed '
'to enable RC re-election', sess)
LOG.info('Stale session %s destroyed '
'to enable RC re-election', sess)
else:
util.destroy_session(sess)
LOG.debug('Stale session %s destroyed to enable RC re-election', sess)
LOG.info('Stale session %s destroyed to enable RC re-election', sess)


@log_exception
Expand Down
Loading

0 comments on commit bd943b6

Please sign in to comment.