Refactored command line handling

This commit is contained in:
Bartek Kryza
2023-03-11 18:59:53 +01:00
parent 41537c5401
commit f1c125bf32
17 changed files with 1066 additions and 609 deletions

View File

@@ -28,29 +28,29 @@
#include <vector>
#define LOG_ERROR(fmt__, ...) \
spdlog::get("console")->error( \
fmt::runtime(std::string("[{}:{}] ") + fmt__), FILENAME_, __LINE__, \
##__VA_ARGS__)
spdlog::get("clanguml-logger") \
->error(fmt::runtime(std::string("[{}:{}] ") + fmt__), FILENAME_, \
__LINE__, ##__VA_ARGS__)
#define LOG_WARN(fmt__, ...) \
spdlog::get("console")->warn( \
fmt::runtime(std::string("[{}:{}] ") + fmt__), FILENAME_, __LINE__, \
##__VA_ARGS__)
spdlog::get("clanguml-logger") \
->warn(fmt::runtime(std::string("[{}:{}] ") + fmt__), FILENAME_, \
__LINE__, ##__VA_ARGS__)
#define LOG_INFO(fmt__, ...) \
spdlog::get("console")->info( \
fmt::runtime(std::string("[{}:{}] ") + fmt__), FILENAME_, __LINE__, \
##__VA_ARGS__)
spdlog::get("clanguml-logger") \
->info(fmt::runtime(std::string("[{}:{}] ") + fmt__), FILENAME_, \
__LINE__, ##__VA_ARGS__)
#define LOG_DBG(fmt__, ...) \
spdlog::get("console")->debug( \
fmt::runtime(std::string("[{}:{}] ") + fmt__), FILENAME_, __LINE__, \
##__VA_ARGS__)
spdlog::get("clanguml-logger") \
->debug(fmt::runtime(std::string("[{}:{}] ") + fmt__), FILENAME_, \
__LINE__, ##__VA_ARGS__)
#define LOG_TRACE(fmt__, ...) \
spdlog::get("console")->trace( \
fmt::runtime(std::string("[{}:{}] ") + fmt__), FILENAME_, __LINE__, \
##__VA_ARGS__)
spdlog::get("clanguml-logger") \
->trace(fmt::runtime(std::string("[{}:{}] ") + fmt__), FILENAME_, \
__LINE__, ##__VA_ARGS__)
namespace clanguml::util {
@@ -61,13 +61,6 @@ std::string trim(const std::string &s);
#define FILENAME_ \
(strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
/**
* @brief Setup spdlog logger.
*
* @param verbose Whether the logging should be verbose or not.
*/
void setup_logging(int verbose);
std::string get_process_output(const std::string &command);
std::string get_env(const std::string &name);