From e42f3541d9e16264f79e090ddd87b864f5c2a837 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 3 Jul 2020 09:27:46 +0200 Subject: more consistent logging; use logger. instead of logging. where appropriate --- lib/data_parameters.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'lib/data_parameters.py') diff --git a/lib/data_parameters.py b/lib/data_parameters.py index 1150b71..84eacfd 100644 --- a/lib/data_parameters.py +++ b/lib/data_parameters.py @@ -7,9 +7,12 @@ length of lists, ane more. from .protocol_benchmarks import codegen_for_lib from . import cycles_to_energy, size_to_radio_energy, utils +import logging import numpy as np import ubjson +logger = logging.getLogger(__name__) + def _string_value_length(json): if type(json) == str: @@ -224,7 +227,7 @@ class Protolog: except KeyError: pass except TypeError as e: - print( + logger.error( "TypeError in {} {} {} {}: {} -> {}".format( arch_lib, benchmark, @@ -395,7 +398,7 @@ class Protolog: except KeyError: pass except ValueError: - print( + logger.warning( "cycles_enc is NaN for {} -> {} -> {}".format( arch, lib, key ) @@ -410,7 +413,7 @@ class Protolog: except KeyError: pass except ValueError: - print( + logger.warning( "cycles_ser is NaN for {} -> {} -> {}".format( arch, lib, key ) @@ -425,7 +428,7 @@ class Protolog: except KeyError: pass except ValueError: - print( + logger.warning( "cycles_encser is NaN for {} -> {} -> {}".format( arch, lib, key ) @@ -440,7 +443,7 @@ class Protolog: except KeyError: pass except ValueError: - print( + logger.warning( "cycles_des is NaN for {} -> {} -> {}".format( arch, lib, key ) @@ -455,7 +458,7 @@ class Protolog: except KeyError: pass except ValueError: - print( + logger.warning( "cycles_dec is NaN for {} -> {} -> {}".format( arch, lib, key ) @@ -470,7 +473,7 @@ class Protolog: except KeyError: pass except ValueError: - print( + logger.warning( "cycles_desdec is NaN for {} -> {} -> {}".format( arch, lib, key ) -- cgit v1.2.3