|
13 | 13 | import base64 |
14 | 14 | import datetime |
15 | 15 | from functools import cached_property |
16 | | -from logging import Logger |
17 | 16 | from typing import TYPE_CHECKING, Any, ClassVar, Dict, Generic, Iterator, List, Optional, Tuple, Type, TypeVar |
18 | 17 | from uuid import UUID |
19 | 18 |
|
20 | 19 | from aiida.common import exceptions |
21 | 20 | from aiida.common.lang import classproperty, type_check |
22 | 21 | from aiida.common.links import LinkType |
| 22 | +from aiida.common.log import AIIDA_LOGGER |
23 | 23 | from aiida.common.pydantic import MetadataField |
24 | 24 | from aiida.common.warnings import warn_deprecation |
25 | 25 | from aiida.manage import get_manager |
|
43 | 43 | if TYPE_CHECKING: |
44 | 44 | from importlib_metadata import EntryPoint |
45 | 45 |
|
| 46 | + from aiida.common.log import AiidaLoggerType |
| 47 | + |
46 | 48 | from ..implementation import StorageBackend |
47 | 49 | from ..implementation.nodes import BackendNode # noqa: F401 |
48 | 50 | from .repository import NodeRepository |
@@ -174,8 +176,8 @@ def _query_type_string(cls) -> str: # noqa: N805 |
174 | 176 | cls.__query_type_string = get_query_type_from_type_string(cls._plugin_type_string) # type: ignore[misc] |
175 | 177 | return cls.__query_type_string |
176 | 178 |
|
177 | | - # This will be set by the metaclass call |
178 | | - _logger: Optional[Logger] = None |
| 179 | + # This will be set by the metaclass call but we set default |
| 180 | + _logger: AiidaLoggerType = AIIDA_LOGGER |
179 | 181 |
|
180 | 182 | # A tuple of attribute names that can be updated even after node is stored |
181 | 183 | # Requires Sealable mixin, but needs empty tuple for base class |
@@ -407,7 +409,7 @@ def entry_point(cls) -> Optional['EntryPoint']: # noqa: N805 |
407 | 409 | return get_entry_point_from_class(cls.__module__, cls.__name__)[1] |
408 | 410 |
|
409 | 411 | @property |
410 | | - def logger(self) -> Optional[Logger]: |
| 412 | + def logger(self) -> Optional[AiidaLoggerType]: |
411 | 413 | """Return the logger configured for this Node. |
412 | 414 |
|
413 | 415 | :return: Logger object |
|
0 commit comments