private async Task <int> MainInternalAsync(string[] args) { var options = CommandLineOptions.Parse(args, _stdout, _stderr); var loggerFactory = new LoggerFactory(); var commandProvider = new CommandOutputProvider { LogLevel = ResolveLogLevel(options) }; loggerFactory.AddProvider(commandProvider); var logger = loggerFactory.CreateLogger(LoggerName); if (string.IsNullOrEmpty(options.WatchPath.Value)) { // invalid args syntax return(1); } await new DotNetWatcher(logger).WatchAsync(new List <string> { options.WatchPath.Value }, _cancellationToken); return(0); }
public CommandOutputLogger(CommandOutputProvider commandOutputProvider, string loggerName) { _provider = commandOutputProvider; _outConsole = AnsiConsole.GetOutput(); _loggerName = loggerName; }