Skip to content

Commit

Permalink
only print logs on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
jori-nordic committed Aug 19, 2022
1 parent fabf488 commit 8f951ee
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 3 additions & 2 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ def testdevices(flasheddevices):
devices = {'dut': dut, 'tester': tester}
LOGGER.info(f'Test devices: {devices}')

# Start RTT logging

yield devices

LOGGER.info(f'[{dut_dk.segger_id}] DUT logs:\n{dut_dk.log}')
LOGGER.info(f'[{tester_dk.segger_id}] Tester logs:\n{tester_dk.log}')

LOGGER.debug('closing RPC channels')
9 changes: 8 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
[pytest]
filterwarnings =
ignore:.*JLink module.*:PendingDeprecationWarning

# Logging
log_level = INFO
log_format = %(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)
log_date_format=%Y-%m-%d %H:%M:%S

# Live console logs
log_cli = 1
log_cli_level = INFO
log_cli_level = WARNING
log_cli_format = %(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)
log_cli_date_format=%Y-%m-%d %H:%M:%S
1 change: 0 additions & 1 deletion targettest/targettest/devkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ def stop_logging(self):
self.rtt.close()
finally:
LOGGER.debug(f'[{self.segger_id}] logging stopped')
LOGGER.info(f'[{self.segger_id}] device logs:\n{self.log}')

def open(self, open_emu=True):
LOGGER.debug(f'[{self.segger_id}] devkit open')
Expand Down

0 comments on commit 8f951ee

Please sign in to comment.