diff --git a/src/GitReleaseManager.Cli/Logging/LogConfiguration.cs b/src/GitReleaseManager.Cli/Logging/LogConfiguration.cs index b03f0e57..1799709f 100644 --- a/src/GitReleaseManager.Cli/Logging/LogConfiguration.cs +++ b/src/GitReleaseManager.Cli/Logging/LogConfiguration.cs @@ -43,7 +43,7 @@ private static void CreateConsoleFullLogger(LoggerConfiguration config, string c .Filter.ByExcluding((logEvent) => !options.Verbose && logEvent.Level == LogEventLevel.Verbose) .WriteTo.Console( outputTemplate: consoleTemplate, - standardErrorFromLevel: LogEventLevel.Warning, + standardErrorFromLevel: options.IsCISystem ? LogEventLevel.Error : LogEventLevel.Warning, theme: consoleTheme)); } diff --git a/src/GitReleaseManager.Core/Options/BaseSubOptions.cs b/src/GitReleaseManager.Core/Options/BaseSubOptions.cs index c8a15ad1..9d8b1251 100644 --- a/src/GitReleaseManager.Core/Options/BaseSubOptions.cs +++ b/src/GitReleaseManager.Core/Options/BaseSubOptions.cs @@ -1,9 +1,21 @@ +using System; using CommandLine; namespace GitReleaseManager.Core.Options { public abstract class BaseSubOptions { + protected BaseSubOptions() + { + var ciEnvironmentVariable = Environment.GetEnvironmentVariable("CI"); + + bool isCiSystem; + if (!string.IsNullOrEmpty(ciEnvironmentVariable) && bool.TryParse(ciEnvironmentVariable, out isCiSystem)) + { + IsCISystem = isCiSystem; + } + } + [Option("debug", HelpText = "Enable debugging console output")] public bool Debug { get; set; } @@ -18,5 +30,8 @@ public abstract class BaseSubOptions [Option("verbose", HelpText = "Enable verbose console output")] public bool Verbose { get; set; } + + [Option("ci", HelpText = "Configure GitReleaseManager to be compatible with CI systems")] + public bool IsCISystem { get; set; } } } \ No newline at end of file