|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
|
|
import abc
|
|
import abc
|
|
|
import dataclasses
|
|
import dataclasses
|
|
|
|
|
+import logging
|
|
|
import os
|
|
import os
|
|
|
|
|
|
|
|
from contextlib import contextmanager
|
|
from contextlib import contextmanager
|
|
@@ -139,6 +140,18 @@ class Action(BaseModel, abc.ABC):
|
|
|
inputs: Inputs = Inputs()
|
|
inputs: Inputs = Inputs()
|
|
|
outputs: Outputs = Outputs()
|
|
outputs: Outputs = Outputs()
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def log(
|
|
|
|
|
+ cls,
|
|
|
|
|
+ message: str,
|
|
|
|
|
+ *args: Any,
|
|
|
|
|
+ indent: int = 0,
|
|
|
|
|
+ level: int = logging.INFO,
|
|
|
|
|
+ **kwargs: Any,
|
|
|
|
|
+ ) -> None:
|
|
|
|
|
+ logger = logging.getLogger(cls.__name__)
|
|
|
|
|
+ logger.log(level, (" " * indent) + message, *args, **kwargs)
|
|
|
|
|
+
|
|
|
# pylint: disable=unused-argument
|
|
# pylint: disable=unused-argument
|
|
|
def enabled(self, status: Status, context: Context) -> bool:
|
|
def enabled(self, status: Status, context: Context) -> bool:
|
|
|
"""Should this action even be run?"""
|
|
"""Should this action even be run?"""
|