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

27 lines
513 B
C++

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