File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -81,13 +81,14 @@ def run(self, command: BaseCommand) -> Result:
8181 self .logger .debug (f"Template-Command: '{ command .cmd } '" )
8282 if command .background :
8383 # Background commands always return Result(None,None)
84+ time_of_execution = datetime .now ().isoformat ()
85+ self .log_json (self .json_logger , command , time_of_execution )
8486 result = self .exec_background (self .substitute_template_vars (command , self .substitute_cmd_vars ))
8587 else :
8688 result = self .exec (self .substitute_template_vars (command , self .substitute_cmd_vars ))
8789
8890 return result
8991
90-
9192 def log_command (self , command ):
9293 """Log starting-status of the command"""
9394 self .logger .info (f"Executing '{ command } '" )
Original file line number Diff line number Diff line change 1+ import json
12from attackmate .schemas .base import BaseCommand
23from attackmate .processmanager import ProcessManager
34from attackmate .result import Result
@@ -30,7 +31,8 @@ def _create_queue(self) -> Optional[Queue]:
3031
3132 def exec_background (self , command : BaseCommand ) -> Result :
3233 self .logger .info (f'Run in background: { getattr (command , "type" , "" )} ({ command .cmd } )' )
33-
34+ if command .metadata :
35+ self .logger .info (f'Metadata: { json .dumps (command .metadata )} ' )
3436 queue = self ._create_queue ()
3537
3638 if queue :
You can’t perform that action at this time.
0 commit comments