Skip to content

Commit 24e4ce8

Browse files
committed
(GH-49) Write to console when no logfile specified
1 parent 033ff98 commit 24e4ce8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Source/GitHubReleaseManager.Cli/Program.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,7 @@ private static void ConfigureLogging(string logFilePath)
317317
s => log.AppendLine(s)
318318
};
319319

320-
if (logFilePath == "console")
321-
{
322-
writeActions.Add(Console.WriteLine);
323-
}
324-
else if (!string.IsNullOrEmpty(logFilePath))
320+
if (!string.IsNullOrEmpty(logFilePath))
325321
{
326322
try
327323
{
@@ -340,6 +336,11 @@ private static void ConfigureLogging(string logFilePath)
340336
Console.WriteLine("Failed to configure logging: " + ex.Message);
341337
}
342338
}
339+
else
340+
{
341+
// if nothing else is specified, write to console
342+
writeActions.Add(Console.WriteLine);
343+
}
343344

344345
Logger.WriteInfo = s => writeActions.ForEach(a => a(s));
345346
Logger.WriteWarning = s => writeActions.ForEach(a => a(s));

0 commit comments

Comments
 (0)