Skip to content

Commit

Permalink
Check that log tag is non-empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
AYMENJD authored and levlam committed Oct 5, 2024
1 parent 4ac7811 commit df8d710
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions td/telegram/Logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ vector<string> Logging::get_tags() {
}

Status Logging::set_tag_verbosity_level(Slice tag, int new_verbosity_level) {
if (tag.empty()) {
return Status::Error("Log tag must be non-empty")
}

auto it = log_tags.find(tag);
if (it == log_tags.end()) {
return Status::Error("Log tag is not found");
Expand All @@ -138,6 +142,10 @@ Status Logging::set_tag_verbosity_level(Slice tag, int new_verbosity_level) {
}

Result<int> Logging::get_tag_verbosity_level(Slice tag) {
if (tag.empty()) {
return Status::Error("Log tag must be non-empty")
}

auto it = log_tags.find(tag);
if (it == log_tags.end()) {
return Status::Error("Log tag is not found");
Expand Down

0 comments on commit df8d710

Please sign in to comment.