diff --git a/ydb/public/lib/ydb_cli/commands/ydb_admin.cpp b/ydb/public/lib/ydb_cli/commands/ydb_admin.cpp index 0dfab05a11a0..c14f01ea163c 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_admin.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_admin.cpp @@ -54,7 +54,7 @@ void TCommandDatabaseDump::Parse(TConfig& config) { } int TCommandDatabaseDump::Run(TConfig& config) { - auto log = std::make_shared(CreateLogBackend("cerr", TConfig::VerbosityLevelToELogPriority(config.VerbosityLevel))); + auto log = std::make_shared(CreateLogBackend("cerr", TConfig::VerbosityLevelToELogPriorityChatty(config.VerbosityLevel))); log->SetFormatter(GetPrefixLogFormatter("")); NDump::TClient client(CreateDriver(config), std::move(log)); @@ -87,7 +87,7 @@ void TCommandDatabaseRestore::Parse(TConfig& config) { } int TCommandDatabaseRestore::Run(TConfig& config) { - auto log = std::make_shared(CreateLogBackend("cerr", TConfig::VerbosityLevelToELogPriority(config.VerbosityLevel))); + auto log = std::make_shared(CreateLogBackend("cerr", TConfig::VerbosityLevelToELogPriorityChatty(config.VerbosityLevel))); log->SetFormatter(GetPrefixLogFormatter("")); auto settings = NDump::TRestoreDatabaseSettings() diff --git a/ydb/public/lib/ydb_cli/commands/ydb_cluster.cpp b/ydb/public/lib/ydb_cli/commands/ydb_cluster.cpp index 1e67ebc496ce..49fc537402d0 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_cluster.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_cluster.cpp @@ -66,7 +66,7 @@ void TCommandClusterDump::Parse(TConfig& config) { } int TCommandClusterDump::Run(TConfig& config) { - auto log = std::make_shared(CreateLogBackend("cerr", TConfig::VerbosityLevelToELogPriority(config.VerbosityLevel))); + auto log = std::make_shared(CreateLogBackend("cerr", TConfig::VerbosityLevelToELogPriorityChatty(config.VerbosityLevel))); log->SetFormatter(GetPrefixLogFormatter("")); NDump::TClient client(CreateDriver(config), std::move(log)); @@ -99,7 +99,7 @@ void TCommandClusterRestore::Parse(TConfig& config) { } int TCommandClusterRestore::Run(TConfig& config) { - auto log = std::make_shared(CreateLogBackend("cerr", TConfig::VerbosityLevelToELogPriority(config.VerbosityLevel))); + auto log = std::make_shared(CreateLogBackend("cerr", TConfig::VerbosityLevelToELogPriorityChatty(config.VerbosityLevel))); log->SetFormatter(GetPrefixLogFormatter("")); auto settings = NDump::TRestoreClusterSettings() diff --git a/ydb/public/lib/ydb_cli/common/command.cpp b/ydb/public/lib/ydb_cli/common/command.cpp index 619cc8890b50..c91cb24c3506 100644 --- a/ydb/public/lib/ydb_cli/common/command.cpp +++ b/ydb/public/lib/ydb_cli/common/command.cpp @@ -47,6 +47,18 @@ ELogPriority TClientCommand::TConfig::VerbosityLevelToELogPriority(TClientComman } } +ELogPriority TClientCommand::TConfig::VerbosityLevelToELogPriorityChatty(TClientCommand::TConfig::EVerbosityLevel lvl) { + switch (lvl) { + case TClientCommand::TConfig::EVerbosityLevel::NONE: + return ELogPriority::TLOG_INFO; + case TClientCommand::TConfig::EVerbosityLevel::DEBUG: + case TClientCommand::TConfig::EVerbosityLevel::INFO: + case TClientCommand::TConfig::EVerbosityLevel::WARN: + return ELogPriority::TLOG_DEBUG; + } + return ELogPriority::TLOG_INFO; +} + size_t TClientCommand::TConfig::ParseHelpCommandVerbosilty(int argc, char** argv) { size_t cnt = 0; for (int i = 0; i < argc; ++i) { diff --git a/ydb/public/lib/ydb_cli/common/command.h b/ydb/public/lib/ydb_cli/common/command.h index 0614d1b1d5af..324a729c5c3c 100644 --- a/ydb/public/lib/ydb_cli/common/command.h +++ b/ydb/public/lib/ydb_cli/common/command.h @@ -91,6 +91,7 @@ class TClientCommand { }; static ELogPriority VerbosityLevelToELogPriority(EVerbosityLevel lvl); + static ELogPriority VerbosityLevelToELogPriorityChatty(EVerbosityLevel lvl); int ArgC; char** ArgV;