mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 10:01:33 +08:00
remove info_logger
This commit is contained in:
parent
2ac214aed8
commit
344b3d2834
@ -55,18 +55,12 @@ int main(int argc, char* argv[])
|
||||
using std::endl;
|
||||
|
||||
//auto fsink2 = std::make_shared<sinks::rotating_file_sink>("log", "txt", 1024*1024*50 , 5, seconds(1));
|
||||
auto &logger2 = c11log::get_logger("logger2");
|
||||
//logger2.add_sink(fsink2);
|
||||
logger2.add_sink(std::make_shared<sinks::null_sink>());
|
||||
logger2.add_sink(std::make_shared<sinks::stdout_sink>());
|
||||
|
||||
info_logger info(&logger2);
|
||||
info << "Hello info logger" << "!!";
|
||||
return 0;
|
||||
auto &my_logger = get_logger("example");
|
||||
auto start = system_clock::now();
|
||||
|
||||
const unsigned int howmany = 10000000;
|
||||
for(unsigned int i = 0; i < howmany ; i++)
|
||||
logger2.info() << "Hello logger " << i;
|
||||
my_logger.info() << "Hello logger " << i;
|
||||
|
||||
auto delta = system_clock::now() - start;
|
||||
auto delta_d = duration_cast<duration<double>> (delta);
|
||||
|
@ -169,17 +169,3 @@ inline c11log::logger& c11log::get_logger(const std::string& name)
|
||||
return *(c11log::details::factory::instance().get_logger(name));
|
||||
}
|
||||
|
||||
|
||||
namespace c11log {
|
||||
class info_logger {
|
||||
public:
|
||||
info_logger (c11log::logger* logger):_logger(logger) {}
|
||||
template<class T>
|
||||
details::line_logger& operator<<(const T& msg) {
|
||||
return _logger->info() << msg;
|
||||
}
|
||||
|
||||
private:
|
||||
c11log::logger* _logger;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user