myxlib/examples/log/02_qt/qt.cpp

27 lines
521 B
C++
Raw Normal View History

#include <myx/log/spdlog.hpp>
#include <myx/log/spdlog_qt.hpp>
namespace ML = myx::log;
int main( int argc, char** argv )
{
2019-10-04 12:33:49 +00:00
(void)argc;
(void)argv;
ML::default_logger.enableStdoutSink();
2019-10-04 12:33:49 +00:00
spdlog::register_logger( ML::default_logger.logger() );
spdlog::set_default_logger( ML::default_logger.logger() );
qInstallMessageHandler( ML::spdlog_qt_message_handler );
2019-10-04 12:33:49 +00:00
qInfo() << "info";
qDebug() << "debug";
spdlog::set_pattern( "[%H:%M:%S %z] %v" );
2019-10-04 12:33:49 +00:00
qInfo( "new info" );
qDebug( "new debug" );
return( 0 );
}