Skip to content

Commit

Permalink
added error logs to fit_parser and FIXME for better logger interface
Browse files Browse the repository at this point in the history
  • Loading branch information
neri14 committed Aug 10, 2024
1 parent f9ffe5b commit 36a92f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/telemetry/fit_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ namespace telemetry {
std::shared_ptr<datapoint_sequence> fit_parser::parse(const std::filesystem::path& path)
{
if (!std::filesystem::exists(path)) {
//FIXME add error log
log.error(std::format("File does not exist: {}", path.string()));
//FIXME implement logging methods that take arguments like std::format i.e.: log.error("File does not exist: {}", path.string());

return nullptr;
}

if (path.extension() != ".fit") {
//FIXME add error log
log.error(std::format("File extension is not .fit: {}", path.string()));
return nullptr;
}

Expand Down
5 changes: 5 additions & 0 deletions src/telemetry/fit_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include "parser.h"

#include "utils/logging/logger.h"

namespace vgraph {
namespace telemetry {

Expand All @@ -12,6 +14,9 @@ class fit_parser : public parser {
~fit_parser() = default;

std::shared_ptr<datapoint_sequence> parse(const std::filesystem::path& path) override;

private:
utils::logging::logger log{"fit_parser"};
};

} // namespace telemetry
Expand Down

0 comments on commit 36a92f2

Please sign in to comment.