Try to fix test, rename arg

This commit is contained in:
Dmitry Kardymon 2023-07-19 13:29:07 +00:00
parent aa888ad64a
commit 688b55b6ff
4 changed files with 11 additions and 10 deletions

View File

@ -41,9 +41,9 @@ ISystemLog::~ISystemLog() = default;
template <typename LogElement>
SystemLogQueue<LogElement>::SystemLogQueue(
const String & name_,
const String & table_name_,
size_t flush_interval_milliseconds_)
: log(&Poco::Logger::get(name_))
: log(&Poco::Logger::get("SystemLogQueue (" + table_name_ + ")"))
, flush_interval_milliseconds(flush_interval_milliseconds_)
{}
@ -120,6 +120,7 @@ void SystemLogQueue<LogElement>::push(const LogElement & element)
template <typename LogElement>
uint64_t SystemLogQueue<LogElement>::notifyFlush(bool should_prepare_tables_anyway)
{
uint64_t this_thread_requested_offset;
{
@ -204,10 +205,10 @@ void SystemLogQueue<LogElement>::shutdown()
template <typename LogElement>
SystemLogBase<LogElement>::SystemLogBase(
const String& name,
const String& table_name_,
size_t flush_interval_milliseconds_,
std::shared_ptr<SystemLogQueue<LogElement>> queue_)
: queue(queue_ ? queue_ : std::make_shared<SystemLogQueue<LogElement>>(name, flush_interval_milliseconds_))
: queue(queue_ ? queue_ : std::make_shared<SystemLogQueue<LogElement>>(table_name_, flush_interval_milliseconds_))
{
}

View File

@ -80,7 +80,7 @@ class SystemLogQueue
public:
SystemLogQueue(
const String & name_,
const String & table_name_,
size_t flush_interval_milliseconds_);
void shutdown();
@ -130,7 +130,7 @@ public:
using Self = SystemLogBase;
SystemLogBase(
const String& name,
const String& table_name_,
size_t flush_interval_milliseconds_,
std::shared_ptr<SystemLogQueue<LogElement>> queue_ = nullptr);

View File

@ -255,10 +255,10 @@ void Loggers::buildLoggers(Poco::Util::AbstractConfiguration & config, Poco::Log
#ifndef WITHOUT_TEXT_LOG
if (config.has("text_log"))
{
String text_log_level_str = config.getString("text_log.level", "");
int text_log_level = text_log_level_str.empty() ? INT_MAX : Poco::Logger::parseLevel(text_log_level_str);
String text_log_level_str = config.getString("text_log.level", "trace");
int text_log_level = Poco::Logger::parseLevel(text_log_level_str);
size_t flush_interval_milliseconds = config.getUInt64("text_log.flush_interval_milliseconds",
DEFAULT_SYSTEM_LOG_FLUSH_INTERVAL_MILLISECONDS);
DEFAULT_SYSTEM_LOG_FLUSH_INTERVAL_MILLISECONDS);
split->addTextLog(DB::TextLog::getLogQueue(flush_interval_milliseconds), text_log_level);
}
#endif

View File

@ -1,2 +1,2 @@
SYSTEM FLUSH LOGS;
SELECT count() > 0 FROM system.text_log WHERE event_date >= yesterday() AND message LIKE '%Application: Starting ClickHouse%';
SELECT count() > 0 FROM system.text_log WHERE event_date >= yesterday() AND message LIKE '%Starting ClickHouse%';