creators have logger

This commit is contained in:
iLLiCiTiT 2021-07-08 10:57:46 +02:00
parent 94bb9f38a3
commit d0e9080b3b

View file

@ -1,4 +1,5 @@
import copy
import logging
import collections
from uuid import uuid4
@ -87,6 +88,9 @@ class BaseCreator:
to `self` if it's not Plugin specific.
"""
# Variable to store logger
_log = None
# Creator is enabled (Probably does not have reason of existence?)
enabled = True
@ -104,6 +108,12 @@ class BaseCreator:
"""Family that plugin represents."""
pass
@property
def log(self):
if self._log is None:
self._log = logging.getLogger(self.__class__.__name__)
return self._log
@abstractmethod
def create(self, options=None):
"""Create new instance.