[FancyZones] Move FancyZones out of the runner process (#11818)

* rename dll -> FancyZonesModuleInterface (#11488)

* [FancyZones] Rename "fancyzones/tests" -> "fancyzones/FancyZonesTests" (#11492)

* [FancyZones] Rename "fancyzones/lib" -> "fancyzones/FancyZonesLib" (#11489)

* [FancyZones] New FancyZones project. (#11544)

* [FancyZones] Allow single instance of "PowerToys.FancyZones.exe" (#11558)

* [FancyZones] Updated bug reports (#11571)

* [FancyZones] Updated installer (#11572)

* [FancyZones] Update string resources (#11596)

* [FancyZones] Terminate FancyZones with runner (#11696)

* [FancyZones] Drop support for the module interface API to save settings (#11661)

* Settings telemetry for FancyZones (#11766)

* commented out test

* enable dpi awareness for the process
This commit is contained in:
Seraphima Zykova
2021-06-23 15:48:54 +03:00
committed by GitHub
parent bdf85989fc
commit c93eb92cd0
110 changed files with 5753 additions and 5293 deletions

View File

@@ -0,0 +1,53 @@
#include "pch.h"
#include "CallTracer.h"
#include <thread>
namespace
{
// Non-localizable
const std::string entering = " Enter";
const std::string exiting = " Exit";
std::mutex indentLevelMutex;
std::map<std::thread::id, int> indentLevel;
std::string GetIndentation()
{
std::unique_lock lock(indentLevelMutex);
int level = indentLevel[std::this_thread::get_id()];
if (level <= 0)
{
return {};
}
else
{
return std::string(2 * min(level, 64) - 1, ' ') + " - ";
}
}
void Indent()
{
std::unique_lock lock(indentLevelMutex);
indentLevel[std::this_thread::get_id()]++;
}
void Unindent()
{
std::unique_lock lock(indentLevelMutex);
indentLevel[std::this_thread::get_id()]--;
}
}
CallTracer::CallTracer(const char* functionName) :
functionName(functionName)
{
Logger::trace((GetIndentation() + functionName + entering).c_str());
Indent();
}
CallTracer::~CallTracer()
{
Unindent();
Logger::trace((GetIndentation() + functionName + exiting).c_str());
}