Skip to content
This repository has been archived by the owner on Sep 20, 2022. It is now read-only.

Fix logging so that error details are output to console. #118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/GitReleaseNotes/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ namespace GitReleaseNotes
public static class Program
{
// TODO Fix logging.. Just choose serilog or something which liblog picks up
private static readonly ILog Log = GitReleaseNotesEnvironment.Log;
private static ILog Log
{
get { return GitReleaseNotesEnvironment.Log; }
}

public static int Main(string[] args)
{
Expand Down Expand Up @@ -83,7 +86,7 @@ public static int Main(string[] args)
catch (Exception ex)
{
exitCode = -2;
Log.WriteLine("An unexpected error occurred: {0}", ex.Message);
Log.WriteLine("An unexpected error occurred: {0}", ex.GetBaseException().Message);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should catch aggregate exceptions specifically to do this. Just in case it's not an aggregate exception

}

if (Debugger.IsAttached)
Expand Down