wip static lib

This commit is contained in:
gabime 2019-04-06 01:25:33 +03:00
parent c69c49047b
commit 4dd1a24d0b
2 changed files with 6 additions and 6 deletions

View File

@ -14,6 +14,9 @@ spdlog::logger *get_logger();
int main(int, char *[]) int main(int, char *[])
{ {
auto *l = get_logger(); int x = 4;
l->info("HEllo {}", "HG FS"); spdlog::info("HELLO {}", "st at ic");
spdlog::warn("HELLO {}*{} = {}", x, x, x*x);
/*auto *l = get_logger();
l->info("HEllo {}", "HG FS");*/
} }

View File

@ -35,17 +35,14 @@ public:
void register_logger(std::shared_ptr<logger> new_logger); void register_logger(std::shared_ptr<logger> new_logger);
void initialize_logger(std::shared_ptr<logger> new_logger); void initialize_logger(std::shared_ptr<logger> new_logger);
std::shared_ptr<logger> get(const std::string &logger_name); std::shared_ptr<logger> get(const std::string &logger_name);
std::shared_ptr<logger> default_logger(); std::shared_ptr<logger> default_logger();
// Return raw ptr to the default logger. // Return raw ptr to the default logger.
// To be used directly by the spdlog default api (e.g. spdlog::info) // To be used directly by the spdlog default api (e.g. spdlog::info)
// This make the default API faster, but cannot be used concurrently with set_default_logger(). // This make the default API faster, but cannot be used concurrently with set_default_logger().
// e.g do not call set_default_logger() from one thread while calling spdlog::info() from another. // e.g do not call set_default_logger() from one thread while calling spdlog::info() from another.
logger *get_default_raw(); logger *get_default_raw();
// set default logger. // set default logger.
// default logger is stored in default_logger_ (for faster retrieval) and in the loggers_ map. // default logger is stored in default_logger_ (for faster retrieval) and in the loggers_ map.
void set_default_logger(std::shared_ptr<logger> new_default_logger); void set_default_logger(std::shared_ptr<logger> new_default_logger);