Ryan Peden
09/29/2023, 3:26 AMJeff Hale
09/29/2023, 12:45 PMOscar Björhn
10/06/2023, 9:18 AMKen Dallmeyer
10/09/2023, 4:37 PMRyan Peden
10/09/2023, 4:46 PMKen Dallmeyer
10/09/2023, 7:04 PMRyan Peden
10/10/2023, 5:18 AMFlow
attribute, like so:
public class AmazingFlow
{
private readonly ILogger _logger;
public AmazingFlow(ILogger logger)
{
_logger = logger;
}
[Flow(Name = "The World's Greatest Flow", Retries = 3)]
public string GreatFlow(string message)
{
foreach (int i in Range(1, 5))
{
_logger.LogInformation($"{message} {i}");
}
return message;
}
}
and when a Prefect worker or agent runs it, it shows up the Prefect UI as you'd expect along with the log output (see attached screenshot - I used "Hello!" as the message
parameter when I created the deployment).
It does dependency injection, so if you ask for an ILogger, you automatically get a run logger if you're in a flow or task run, and you can of course register your own dependencies and the library will inject them into your flows and tasks.
Feel free to DM if you think it might be useful. I'm writing up a list of which features are essential for a 0.1.0 release and which can wait until later, so I'd appreciate your thoughts.