Engauge Digitizer
2
Toggle main menu visibility
Loading...
Searching...
No Matches
Logger
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
11
MainWindow
*LoggerUpload::m_mainWindow =
static_cast<
MainWindow
*
>
(
nullptr
);
12
13
LoggerUpload::LoggerUpload
()
14
{
15
}
16
17
void
LoggerUpload::bindToMainWindow
(
MainWindow
*mainWindow)
18
{
19
m_mainWindow = mainWindow;
20
}
21
22
void
LoggerUpload::loggerAssert
(
const
char
*condition,
23
const
char
* file,
24
int
line)
25
{
26
loggerOutput (condition,
27
file,
28
line,
29
"assert"
);
30
}
31
32
void
LoggerUpload::loggerCheckPtr
(
const
char
*ptr,
33
const
char
*file,
34
int
line)
35
{
36
loggerOutput (ptr,
37
file,
38
line,
39
"null pointer"
);
40
}
41
42
void
LoggerUpload::loggerOutput(
const
char
*comment,
43
const
char
*file,
44
int
line,
45
const
char
*context)
46
{
47
if
(m_mainWindow !=
nullptr
) {
48
m_mainWindow->
saveErrorReportFileAndExit
(comment,
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
}
LoggerUpload.h
MainWindow.h
LoggerUpload::bindToMainWindow
static void bindToMainWindow(MainWindow *mainWindow)
Bind to MainWindow so this class can access the command stack.
Definition
LoggerUpload.cpp:17
LoggerUpload::loggerAssert
static void loggerAssert(const char *condition, const char *file, int line)
Smart equivalent to standard assert method and Q_ASSERT (in qglobal.h).
Definition
LoggerUpload.cpp:22
LoggerUpload::LoggerUpload
LoggerUpload()
Single constructor.
Definition
LoggerUpload.cpp:13
LoggerUpload::loggerCheckPtr
static void loggerCheckPtr(const char *pointer, const char *file, int line)
Smart equivalent to Q_CHECK_PTR (in qglobal.h). Similar to loggerAssert but for checking newly-alloca...
Definition
LoggerUpload.cpp:32
MainWindow
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition
MainWindow.h:95
MainWindow::saveErrorReportFileAndExit
void saveErrorReportFileAndExit(const char *comment, const char *file, int line, const char *context)
Save error report and exit.
Definition
MainWindow.cpp:1442
Generated on
for Engauge Digitizer by
1.17.0