Skip to content

Commit

Permalink
Restored telegram logging for DEBUG level
Browse files Browse the repository at this point in the history
  • Loading branch information
dennissiemensma committed Feb 19, 2020
1 parent 2538d7c commit 9aec761
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dsmr_datalogger/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@


dsmrreader_logger = logging.getLogger('dsmrreader')
django_logger = logging.getLogger('django')
commands_logger = logging.getLogger('commands')


Expand Down Expand Up @@ -99,6 +98,8 @@ def telegram_to_reading(data):
if params['log_telegrams']:
dsmrreader_logger.info('Received telegram (base64 encoded): %s', base64_data)

commands_logger.debug("Received telegram:\n%s", data)

try:
parsed_telegram = parser.parse(data)
except (InvalidChecksumError, ParseError) as error:
Expand Down Expand Up @@ -150,7 +151,7 @@ def _map_telegram_to_model(parsed_telegram, data):
error_message = 'Discarded telegram with future timestamp(s): {} / {}'.format(
model_fields['timestamp'], model_fields['extra_device_timestamp']
)
django_logger.error(error_message)
commands_logger.error(error_message)
raise InvalidTelegramError(error_message)

# Now we need to split reading & statistics. So we split the dict here.
Expand Down

0 comments on commit 9aec761

Please sign in to comment.