-
Notifications
You must be signed in to change notification settings - Fork 4
Add external logger to the project #220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Grufoony
commented
Nov 25, 2024
- Closes Add external logger #196
| #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) | ||
| // ~/Library/Application Support/dsm/logs/ | ||
| inline static auto const DSM_LOG_FOLDER = | ||
| std::format("{}/Library/Application Support/dsm/logs/", std::getenv("HOME")); |
Check notice
Code scanning / Flawfinder (reported by Codacy)
Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. Note
| #else // Linux | ||
| // ~/.local/dsm/logs/ | ||
| inline static auto const DSM_LOG_FOLDER = | ||
| std::format("{}/.local/dsm/logs/", std::getenv("HOME")); |
Check notice
Code scanning / Flawfinder (reported by Codacy)
Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. Note
| #elif __APPLE__ | ||
| // %appdata%/dsm/logs | ||
| inline static auto const DSM_LOG_FOLDER = | ||
| std::format("{}\\dsm\\logs\\", std::getenv("APPDATA")); |
Check notice
Code scanning / Flawfinder (reported by Codacy)
Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. Note
| required=True, | ||
| help="Place to get the OSM data in the format: city, province, country", | ||
| ) | ||
| parser = parser.parse_args() |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "parser" doesn't conform to UPPER_CASE naming style Warning
| class Dynamics { | ||
| protected: | ||
| inline static auto const pFileLogger{spdlog::basic_logger_mt( | ||
| "DSM_DYNAMICS_FILE", std::format("{}{}", DSM_LOG_FOLDER, DSM_LOG_FILE), true)}; |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule Note
| "Negative weight ({}) for source node {}.", p.second, p.first); | ||
| pConsoleLogger->critical( | ||
| "Negative weight ({}) for source node {}.", p.second, p.first); | ||
| std::abort(); |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule Note
| pConsoleLogger->critical( | ||
| "Negative weight ({}) for source node {}.", p.second, p.first); | ||
| std::abort(); | ||
| } |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 15.5 rule Note
| /// @param time The value to increment the agent's time by | ||
| /// @throw std::overflow_error, if time has reached its maximum value | ||
| void incrementTime(unsigned int time); | ||
| void incrementTime(unsigned int const time); |
Check notice
Code scanning / Cppcheck (reported by Codacy)
time is Y2038-unsafe Note
| template <typename Delay> | ||
| requires(is_numeric_v<Delay>) | ||
| void Agent<Delay>::incrementTime(unsigned int time) { | ||
| void Agent<Delay>::incrementTime(unsigned int const time) { |
Check notice
Code scanning / Cppcheck (reported by Codacy)
time is Y2038-unsafe Note
| pConsoleLogger->critical( | ||
| "The only source node {} is also the only destination node.", | ||
| src_weights.begin()->first); | ||
| std::abort(); |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule Note
| pConsoleLogger->critical( | ||
| "The only source node {} is also the only destination node.", | ||
| src_weights.begin()->first); | ||
| std::abort(); |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.1 rule Note