Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
# Auto detect text files and perform LF normalization
* text=auto

# exlude assets
Assets/* linguist-vendored
## Linguist

Assets/BundledAssets/* linguist-vendored
Assets/dictionaries/* linguist-vendored

#
# The above will handle all files NOT found below
Expand Down
2 changes: 2 additions & 0 deletions BookGen.slnx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<Solution>
<Folder Name="/Misc/" Id="209479ab-f6dc-4e64-8458-43e805966b28">
<File Path=".editorconfig" />
<File Path=".gitattributes" />
<File Path=".gitignore" />
<File Path="Changelog.md" />
<File Path="Directory.Packages.props" />
<File Path="getting-started.md" />
Expand Down
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Next

* Change: Better logging of critical errors

# 2026. 03. 04 (Prerelease)

* Change: Updated dependencies
Expand Down
6 changes: 3 additions & 3 deletions Source/BookGen.Shell.Shared/BrowserInteract.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//-----------------------------------------------------------------------------
// (c) 2019-2025 Ruzsinszki Gábor
// (c) 2019-2026 Ruzsinszki Gábor
// This code is licensed under MIT license (see LICENSE for details)
//-----------------------------------------------------------------------------

Expand Down Expand Up @@ -78,7 +78,7 @@ public async Task<bool> Html2Pdf(string input, string output)
}
catch (Exception ex)
{
_logger.LogCritical(ex, "Critical Error");
_logger.LogCritical(ex, "Critical Error: {ex}", ex.Message);
return false;
}
}
Expand Down Expand Up @@ -111,7 +111,7 @@ public async Task<bool> Html2Png(string input,
}
catch (Exception ex)
{
_logger.LogCritical(ex, "Critical Error");
_logger.LogCritical(ex, "Critical Error {ex}", ex.Message);
return false;
}
}
Expand Down
4 changes: 1 addition & 3 deletions Source/BookGen.Shell.Shared/Loging/ConsoleLogProvider.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//-----------------------------------------------------------------------------
// (c) 2019-2025 Ruzsinszki Gábor
// (c) 2019-2026 Ruzsinszki Gábor
// This code is licensed under MIT license (see LICENSE for details)
//-----------------------------------------------------------------------------

Expand Down Expand Up @@ -44,13 +44,11 @@ public void Dispose()

internal sealed class ConsoleLogger : IDisposable, ILogger
{
private readonly string _name;
private readonly List<string> _logBuffer;

public ConsoleLogger(string categoryName)
{
_logBuffer = new List<string>();
_name = categoryName;
}

public IDisposable? BeginScope<TState>(TState state) where TState : notnull
Expand Down
4 changes: 2 additions & 2 deletions Source/BookGen.Shellprog/OrganizeCommand.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//-----------------------------------------------------------------------------
// (c) 2019-2025 Ruzsinszki Gábor
// (c) 2019-2026 Ruzsinszki Gábor
// This code is licensed under MIT license (see LICENSE for details)
//-----------------------------------------------------------------------------

Expand Down Expand Up @@ -33,7 +33,7 @@ public override int Execute(OrganizeArguments arguments, IReadOnlyList<string> c
}
catch (Exception ex)
{
_log.LogCritical(ex, "Critical error");
_log.LogCritical(ex, "Critical error: {msg}", ex.Message);
return -1;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Source/BookGen/Commands/EditCommand.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//-----------------------------------------------------------------------------
// (c) 2019-2025 Ruzsinszki Gábor
// (c) 2019-2026 Ruzsinszki Gábor
// This code is licensed under MIT license (see LICENSE for details)
//-----------------------------------------------------------------------------

Expand Down Expand Up @@ -77,7 +77,7 @@ public override int Execute(IReadOnlyList<string> context)
}
catch (Exception ex)
{
_log.LogCritical(ex, "Critical Error");
_log.LogCritical(ex, "Critical Error: {ex}", ex.Message);
return ExitCodes.GeneralError;
}
}
Expand Down