Skip to content

Commit

Permalink
TDM reduce log info
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Bonani committed Jan 24, 2022
1 parent cff357a commit 7a52b02
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions aseba/thymio-device-manager/log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ std::string mobsya::log_filename(const char* path) {
return str;
}

void mobsya::setLogLevel(spdlog::level::level_enum level) {
mobsya::logger->set_level(level);
}

#if WIN32
std::string mobsya::get_last_win32_error_string() {
std::string str;
Expand Down
2 changes: 2 additions & 0 deletions aseba/thymio-device-manager/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ void log(spdlog::level::level_enum level, const char* file, int line, const char
level, fmt::format("{}@L{}:\t{}", mobsya::log_filename(file), line, fmt::format(message, args...)).c_str());
}

void setLogLevel(spdlog::level::level_enum level);

} // namespace mobsya
#define _mobsya_CONCAT2(A, B) A##B
#define _mobsya_CONCAT(A, B) _mobsya_CONCAT2(A, B)
Expand Down
1 change: 1 addition & 0 deletions aseba/thymio-device-manager/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ options parse_options(int argc, char** argv) {
}

int main(int argc, char** argv) {
mobsya::setLogLevel(spdlog::level::info);
auto opts = parse_options(argc, argv);
try {
return start(opts);
Expand Down

0 comments on commit 7a52b02

Please sign in to comment.