Engauge Digitizer 2
Loading...
Searching...
No Matches
LoggerUpload.cpp
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#include <iostream>
8#include "LoggerUpload.h"
9#include "MainWindow.h"
10
11MainWindow *LoggerUpload::m_mainWindow = static_cast<MainWindow*> (nullptr);
12
16
18{
19 m_mainWindow = mainWindow;
20}
21
23 const char* file,
24 int line)
25{
26 loggerOutput (condition,
27 file,
28 line,
29 "assert");
30}
31
33 const char *file,
34 int line)
35{
36 loggerOutput (ptr,
37 file,
38 line,
39 "null pointer");
40}
41
42void LoggerUpload::loggerOutput(const char *comment,
43 const char *file,
44 int line,
45 const char *context)
46{
47 if (m_mainWindow != nullptr) {
49 file,
50 line,
51 context);
52 }
53
54 std::cerr << "Error '" << context << "' at file " << file << " line " << line << ": " << comment << std::endl;
55 exit (-1); // Stop execution since it is no longer safe to continue
56}
const int INNER_RADIUS_MIN
static void bindToMainWindow(MainWindow *mainWindow)
Bind to MainWindow so this class can access the command stack.
static void loggerCheckPtr(const char *pointer, const char *file, int line) Q_NORETURN
Smart equivalent to Q_CHECK_PTR (in qglobal.h). Similar to loggerAssert but for checking newly-alloca...
LoggerUpload()
Single constructor.
static void loggerAssert(const char *condition, const char *file, int line) Q_NORETURN
Smart equivalent to standard assert method and Q_ASSERT (in qglobal.h).
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition MainWindow.h:92
void saveErrorReportFileAndExit(const char *comment, const char *file, int line, const char *context)
Save error report and exit.