From 3b5d8c4ac498e4484267ff18fb183fda81f05ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Da=C3=9Fdorf?= Date: Fri, 24 Nov 2023 15:02:49 +0100 Subject: [PATCH 1/3] fixed wrong logger initialization '__name__' -> __name__ --- asyncua/common/ua_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asyncua/common/ua_utils.py b/asyncua/common/ua_utils.py index 424530252..1635b9555 100644 --- a/asyncua/common/ua_utils.py +++ b/asyncua/common/ua_utils.py @@ -11,7 +11,7 @@ from asyncua import ua -_logger = logging.getLogger('__name__') +_logger = logging.getLogger(__name__) def value_to_datavalue(val, varianttype=None): From fa3a6385c3b519e8b11968b1f66497123f6c4c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Da=C3=9Fdorf?= Date: Thu, 30 Nov 2023 12:30:40 +0100 Subject: [PATCH 2/3] fixed wrong logger initialization '__name__' -> __name__ --- asyncua/ua/ua_binary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asyncua/ua/ua_binary.py b/asyncua/ua/ua_binary.py index 190d1fbf9..ec15b6011 100644 --- a/asyncua/ua/ua_binary.py +++ b/asyncua/ua/ua_binary.py @@ -15,7 +15,7 @@ from ..common.utils import Buffer from .uatypes import type_from_optional, type_is_list, type_is_union, type_from_list, types_or_list_from_union, type_allow_subclass -logger = logging.getLogger('__name__') +logger = logging.getLogger(__name__) T = TypeVar('T') From bec29074dac1482a6e759fa1d60b0dfba1d61774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Da=C3=9Fdorf?= Date: Thu, 30 Nov 2023 12:37:05 +0100 Subject: [PATCH 3/3] :rename logger to _logger when used at module level to avoid unintended imports --- asyncua/ua/ua_binary.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asyncua/ua/ua_binary.py b/asyncua/ua/ua_binary.py index ec15b6011..c1a3ec6a0 100644 --- a/asyncua/ua/ua_binary.py +++ b/asyncua/ua/ua_binary.py @@ -15,7 +15,7 @@ from ..common.utils import Buffer from .uatypes import type_from_optional, type_is_list, type_is_union, type_from_list, types_or_list_from_union, type_allow_subclass -logger = logging.getLogger(__name__) +_logger = logging.getLogger(__name__) T = TypeVar('T') @@ -134,7 +134,7 @@ def pack_array(self, data): if data is None: return Primitives.Int32.pack(-1) if not isinstance(data, (tuple, list)): - logger.warning('ua_binary.py > _Primitive1 > pack_array > data: %s is not a instance of "list"!', data) + _logger.warning('ua_binary.py > _Primitive1 > pack_array > data: %s is not a instance of "list"!', data) return Primitives.Int32.pack(-1) # to prevent crashing while runtime size_data = Primitives.Int32.pack(len(data)) return size_data + struct.pack(self._fmt.format(len(data)), *data)