Self-contained .NET (#22217)

* dotnet sc

* MD preview - C# app

 - working self-contained

* Gcode preview - C# app

* DevFiles preview - C# app

* Fix passing path with spaces as cmd arg and monacocpp proj file

* Pdf preview - C# app

* Svg preview - C# app

* Fix comment

* Gcode thumbnail - C# app

TODO:
	- installer
	- why IThumbnailProvider and IIntializeWithFile doesn't work?

* Pdf thumbnail - C# app

TODO:
        - installer
        - why IThumbnailProvider and IIntializeWithFile doesn't work?

* Pdf thumbnail - C# app

TODO:
        - installer
        - why IThumbnailProvider and IIntializeWithFile doesn't work?

* Fix GcodeThumbnailProviderCpp.vcxproj

* Svg thumbnail - C# app

TODO:
        - installer
        - why IThumbnailProvider and IIntializeWithFile doesn't work?

* Fix Svg tests

* Thumbnail providers - installer

* Self-contained Hosts and FileLocksmith

* Fix hardcoded <RuntimeIdentifier>

* Remove unneeded files

* Try to fix Nuget in PR CI

* Prefix new dlls with PowerToys.
Sign new dlls and exes

* Add new .exe files to ProcessList

* ci: debug by listing all env vars

* ci: try setting variable in the right ci file

* Bring back hardcoded RuntimeIdentifier

* ci: Add comment and remove debug action

* Remove unneeded lib

* [WIP] Platform conditional dotnet files & hardlinks

* Cleanup

* Update expect.txt

* Test fix - ARM installer

* Fix uninstall bug

* Update docs

* Fix failing test

* Add dll details

* Minor cleanup

* Improve resizing

* Add some logs

* Test fix - release build

* Remove InvokeOnControlThread

* Test fix: logger initialization

* Fix arm64 installer

Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
Co-authored-by: Dustin L. Howett <dustin@howett.net>
This commit is contained in:
Stefan Markovic
2022-12-14 13:37:23 +01:00
committed by GitHub
parent a2c0febccc
commit 6ac508fb93
215 changed files with 9060 additions and 2328 deletions

View File

@@ -58,18 +58,24 @@ bool Logger::wasLogFailedShown()
void Logger::init(std::string loggerName, std::wstring logFilePath, std::wstring_view logSettingsPath)
{
auto logLevel = getLogLevel(logSettingsPath);
bool newLoggerCreated = false;
try
{
auto sink = make_shared<daily_file_sink_mt>(logFilePath, 0, 0, false, LogSettings::retention);
if (IsDebuggerPresent())
logger = spdlog::get(loggerName);
if (logger == nullptr)
{
auto msvc_sink = make_shared<msvc_sink_mt>();
msvc_sink->set_pattern("[%Y-%m-%d %H:%M:%S.%f] [%n] [t-%t] [%l] %v");
logger = make_shared<spdlog::logger>(loggerName, sinks_init_list{ sink, msvc_sink });
}
else
{
logger = make_shared<spdlog::logger>(loggerName, sink);
auto sink = make_shared<daily_file_sink_mt>(logFilePath, 0, 0, false, LogSettings::retention);
if (IsDebuggerPresent())
{
auto msvc_sink = make_shared<msvc_sink_mt>();
msvc_sink->set_pattern("[%Y-%m-%d %H:%M:%S.%f] [%n] [t-%t] [%l] %v");
logger = make_shared<spdlog::logger>(loggerName, sinks_init_list{ sink, msvc_sink });
}
else
{
logger = make_shared<spdlog::logger>(loggerName, sink);
}
newLoggerCreated = true;
}
}
catch (...)
@@ -89,10 +95,14 @@ void Logger::init(std::string loggerName, std::wstring logFilePath, std::wstring
return;
}
logger->set_level(logLevel);
logger->set_pattern("[%Y-%m-%d %H:%M:%S.%f] [p-%P] [t-%t] [%l] %v");
logger->flush_on(logLevel); // Auto flush on every log message.
spdlog::register_logger(logger);
if (newLoggerCreated)
{
logger->set_level(logLevel);
logger->set_pattern("[%Y-%m-%d %H:%M:%S.%f] [p-%P] [t-%t] [%l] %v");
logger->flush_on(logLevel); // Auto flush on every log message.
spdlog::register_logger(logger);
}
logger->info("{} logger is initialized", loggerName);
}