Skip to content

Commit

Permalink
Remove redundant \n from critical log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
robomics committed Nov 11, 2024
1 parent 0ca970b commit 446aa78
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/nchg/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,24 +266,24 @@ int main(int argc, char **argv) noexcept {
return cli->exit(e); // This takes care of formatting and printing error
// messages (if any)
} catch (const std::bad_alloc &err) {
SPDLOG_CRITICAL("FAILURE! Unable to allocate enough memory: {}\n", err.what());
SPDLOG_CRITICAL("FAILURE! Unable to allocate enough memory: {}", err.what());

Check warning on line 269 in src/nchg/main.cpp

View check run for this annotation

Codecov / codecov/patch

src/nchg/main.cpp#L269

Added line #L269 was not covered by tests
return 1;
} catch (const spdlog::spdlog_ex &e) {
fmt::print(stderr, "FAILURE! NCHG encountered the following error while logging: {}\n",
e.what());
return 1;
} catch (const std::exception &e) {
if (cli) {
SPDLOG_CRITICAL("FAILURE! NCHG {} encountered the following error: {}\n",
SPDLOG_CRITICAL("FAILURE! NCHG {} encountered the following error: {}",

Check warning on line 277 in src/nchg/main.cpp

View check run for this annotation

Codecov / codecov/patch

src/nchg/main.cpp#L277

Added line #L277 was not covered by tests
cli->get_printable_subcommand(), e.what());
} else {
SPDLOG_CRITICAL("FAILURE! NCHG encountered the following error: {}\n", e.what());
SPDLOG_CRITICAL("FAILURE! NCHG encountered the following error: {}", e.what());

Check warning on line 280 in src/nchg/main.cpp

View check run for this annotation

Codecov / codecov/patch

src/nchg/main.cpp#L280

Added line #L280 was not covered by tests
}
return 1;
} catch (...) {
SPDLOG_CRITICAL(
"FAILURE! NCHG encountered the following error: caught an unhandled exception!\n"
"If you see this message, please file an issue on GitHub.\n");
"If you see this message, please file an issue on GitHub.");

Check warning on line 286 in src/nchg/main.cpp

View check run for this annotation

Codecov / codecov/patch

src/nchg/main.cpp#L286

Added line #L286 was not covered by tests
return 1;
}
return 0;
Expand Down

0 comments on commit 446aa78

Please sign in to comment.