Skip to content

Commit

Permalink
OrcLib: Log: Facility: add alias to Facility
Browse files Browse the repository at this point in the history
  • Loading branch information
fabienfl-orc committed Feb 11, 2021
1 parent 15705cf commit f87e6e8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/OrcCommand/Log/UtilitiesLogger.cpp
Expand Up @@ -93,8 +93,7 @@ UtilitiesLogger::UtilitiesLogger()
auto [defaultLogger, fileLogger] = ::CreateFacilities(m_consoleSink, m_fileSink);

auto loggers = {
std::make_pair(Logger::Facility::kDefault, defaultLogger),
std::make_pair(Logger::Facility::kLogFile, fileLogger)};
std::make_pair(Log::Facility::kDefault, defaultLogger), std::make_pair(Log::Facility::kLogFile, fileLogger)};
m_logger = std::make_shared<Logger>(loggers);

Orc::Log::SetDefaultLogger(m_logger);
Expand Down
2 changes: 2 additions & 0 deletions src/OrcLib/Log/Logger.h
Expand Up @@ -158,6 +158,8 @@ class Logger
std::atomic<uint64_t> m_criticalCount;
};

using Facility = Logger::Facility;

} // namespace Log

using Logger = Orc::Log::Logger;
Expand Down
2 changes: 1 addition & 1 deletion src/OrcLib/Privilege.cpp
Expand Up @@ -143,7 +143,7 @@ HRESULT Orc::GetMyCurrentSID(PSID& pSid)
return hr;
}

if (Log::DefaultLogger()->Get(Logger::Facility::kDefault)->Level() == Log::Level::Debug)
if (Log::DefaultLogger()->Get(Log::Facility::kDefault)->Level() == Log::Level::Debug)
{
LPWSTR pszSid = nullptr;
if (!ConvertSidToStringSid(pSid, &pszSid))
Expand Down
2 changes: 1 addition & 1 deletion src/OrcLib/Text/Console.h
Expand Up @@ -42,7 +42,7 @@ struct StdoutContainerAdapter
static std::basic_string<T> line;
if (c == Traits::newline_v<T>)
{
Log::Info(Logger::Facility::kLogFile, line);
Log::Info(Log::Facility::kLogFile, line);
line.clear();
}
else
Expand Down

0 comments on commit f87e6e8

Please sign in to comment.