New logging system
This commit is contained in:
parent
04b1f2936c
commit
616d874443
14 changed files with 743 additions and 74 deletions
|
@ -1,3 +1,5 @@
|
|||
#include <thread>
|
||||
|
||||
#include <QtGui>
|
||||
#include <QDesktopWidget>
|
||||
#include <QFileDialog>
|
||||
|
@ -5,8 +7,13 @@
|
|||
#include "main.hxx"
|
||||
|
||||
#include "common/common.h"
|
||||
#include "common/platform.h"
|
||||
#include "common/log_manager.h"
|
||||
#include "common/logging/text_formatter.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/logging/backend.h"
|
||||
#include "common/platform.h"
|
||||
#include "common/scope_exit.h"
|
||||
|
||||
#if EMU_PLATFORM == PLATFORM_LINUX
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
@ -33,10 +40,8 @@
|
|||
|
||||
#include "version.h"
|
||||
|
||||
|
||||
GMainWindow::GMainWindow()
|
||||
{
|
||||
LogManager::Init();
|
||||
|
||||
Pica::g_debug_context = Pica::DebugContext::Construct();
|
||||
|
||||
|
@ -271,6 +276,13 @@ void GMainWindow::closeEvent(QCloseEvent* event)
|
|||
|
||||
int __cdecl main(int argc, char* argv[])
|
||||
{
|
||||
std::shared_ptr<Log::Logger> logger = Log::InitGlobalLogger();
|
||||
std::thread logging_thread(Log::TextLoggingLoop, logger);
|
||||
SCOPE_EXIT({
|
||||
logger->Close();
|
||||
logging_thread.join();
|
||||
});
|
||||
|
||||
QApplication::setAttribute(Qt::AA_X11InitThreads);
|
||||
QApplication app(argc, argv);
|
||||
GMainWindow main_window;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue