Skip to content

Commit

Permalink
fix(Common/Logging): correct check existing sink
Browse files Browse the repository at this point in the history
  • Loading branch information
Winfidonarleyan committed Dec 16, 2023
1 parent b74c9cc commit 3b132d3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/common/Logging/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@ void Warhead::Log::CreateSinksFromConfig(std::string_view configSinkName)
if (configSinkName.empty())
return;

if (GetSink(configSinkName))
std::string const& options = sConfigMgr->GetOption<std::string>(std::string{configSinkName }, "");
auto sinkName = configSinkName.substr(PREFIX_SINK_LENGTH);

if (GetSink(sinkName))
{
spdlog::error("Log::CreateSinksFromConfig: {} is exist", configSinkName);
return;
}

std::string const& options = sConfigMgr->GetOption<std::string>(std::string{configSinkName }, "");
auto sinkName = configSinkName.substr(PREFIX_SINK_LENGTH);

auto const& tokens = Warhead::Tokenize(options, ',', true);
if (tokens.size() < 3 || tokens.size() > 7)
{
Expand Down

0 comments on commit 3b132d3

Please sign in to comment.