|
|
@@ -77,6 +77,13 @@ def ipc(func: Run[Action]) -> Run[Action]:
|
|
|
return wrapper
|
|
|
|
|
|
|
|
|
+@contextmanager
|
|
|
+def logging_group(self: Action, message: str, *args: Any) -> Iterator[None]:
|
|
|
+ self.logger.info("##[group] " + message, *args)
|
|
|
+ yield
|
|
|
+ self.logger.info("##[endgroup]")
|
|
|
+
|
|
|
+
|
|
|
@overload
|
|
|
def preamble(
|
|
|
func: Run[Action],
|
|
|
@@ -137,11 +144,10 @@ def preamble(
|
|
|
|
|
|
@functools.wraps(func)
|
|
|
def wrapper(self: Action, context: Context) -> Status:
|
|
|
- self.logger.info("##[group] Run %s", self.name)
|
|
|
- log_inputs(self)
|
|
|
- for color, get_lines in extra:
|
|
|
- log_extra(self, color, get_lines(self))
|
|
|
- self.logger.info("##[endgroup]")
|
|
|
+ with logging_group(self, "Run %s", self.name):
|
|
|
+ log_inputs(self)
|
|
|
+ for color, get_lines in extra:
|
|
|
+ log_extra(self, color, get_lines(self))
|
|
|
return func(self, context)
|
|
|
|
|
|
return wrapper
|