Fix runner warnings (#8211)

This commit is contained in:
Mykhailo Pylyp
2020-11-30 16:16:49 +02:00
committed by GitHub
parent 7c9888300b
commit f0553c370a
17 changed files with 101 additions and 139 deletions

View File

@@ -13,7 +13,7 @@
#include <lib/FancyZonesData.h>
#include <lib/FancyZonesWinHookEventIDs.h>
#include <lib/FancyZonesData.cpp>
#include <lib/FancyZonesLogger.h>
#include <common/logger/logger.h>
extern "C" IMAGE_DOS_HEADER __ImageBase;
@@ -75,7 +75,7 @@ public:
// Enable the powertoy
virtual void enable()
{
FancyZonesLogger::GetLogger()->info("FancyZones enabling");
Logger::info("FancyZones enabling");
if (!m_app)
{
@@ -133,7 +133,7 @@ public:
// Disable the powertoy
virtual void disable()
{
FancyZonesLogger::GetLogger()->info("FancyZones disabling");
Logger::info("FancyZones disabling");
Disable(true);
}
@@ -155,7 +155,9 @@ public:
{
app_name = GET_RESOURCE_STRING(IDS_FANCYZONES);
app_key = NonLocalizable::FancyZonesStr;
FancyZonesLogger::Init(PTSettingsHelper::get_module_save_folder_location(app_key));
std::filesystem::path logFilePath(PTSettingsHelper::get_module_save_folder_location(app_key));
logFilePath.append(LogSettings::fancyZonesLogPath);
Logger::init(LogSettings::fancyZonesLoggerName, logFilePath.wstring(), PTSettingsHelper::get_log_settings_file_location());
m_settings = MakeFancyZonesSettings(reinterpret_cast<HINSTANCE>(&__ImageBase), FancyZonesModule::get_name(), FancyZonesModule::get_key());
FancyZonesDataInstance().LoadFancyZonesData();
s_instance = this;

View File

@@ -102,7 +102,6 @@
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="FancyZonesLogger.h" />
<ClInclude Include="FancyZones.h" />
<ClInclude Include="FancyZonesDataTypes.h" />
<ClInclude Include="FancyZonesWinHookEventIDs.h" />
@@ -128,7 +127,6 @@
<ItemGroup>
<ClCompile Include="FancyZones.cpp" />
<ClCompile Include="FancyZonesDataTypes.cpp" />
<ClCompile Include="FancyZonesLogger.cpp" />
<ClCompile Include="FancyZonesWinHookEventIDs.cpp" />
<ClCompile Include="FancyZonesData.cpp" />
<ClCompile Include="JsonHelpers.cpp" />

View File

@@ -1,24 +0,0 @@
#include "pch.h"
#include <common\settings_helpers.h>
#include <filesystem>
#include "FancyZonesLogger.h"
std::shared_ptr<Logger> FancyZonesLogger::logger;
void FancyZonesLogger::Init(std::wstring moduleSaveLocation)
{
std::filesystem::path logFilePath(moduleSaveLocation);
logFilePath.append(LogSettings::fancyZonesLogPath);
logger = std::make_shared<Logger>(LogSettings::fancyZonesLoggerName, logFilePath.wstring(), PTSettingsHelper::get_log_settings_file_location());
logger->info("FancyZones logger initialized");
}
std::shared_ptr<Logger> FancyZonesLogger::GetLogger()
{
if (!logger)
{
throw "FancyZones logger is not initialized";
}
return logger;
}

View File

@@ -1,10 +0,0 @@
#pragma once
#include <common/logger/logger.h>
class FancyZonesLogger
{
static std::shared_ptr<Logger> logger;
public:
static void Init(std::wstring moduleSaveLocation);
static std::shared_ptr<Logger> GetLogger();
};