Line data Source code
1 : /*
2 : * SPDX-License-Identifier: GPL-3.0-only
3 : * MuseScore-CLA-applies
4 : *
5 : * MuseScore Studio
6 : * Music Composition & Notation
7 : *
8 : * Copyright (C) 2021 MuseScore Limited and others
9 : *
10 : * This program is free software: you can redistribute it and/or modify
11 : * it under the terms of the GNU General Public License version 3 as
12 : * published by the Free Software Foundation.
13 : *
14 : * This program is distributed in the hope that it will be useful,
15 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 : * GNU General Public License for more details.
18 : *
19 : * You should have received a copy of the GNU General Public License
20 : * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 : */
22 : #include "drawlogger.h"
23 :
24 : #include "log.h"
25 :
26 : using namespace muse::draw;
27 :
28 : static const std::string DRAW_OBJ_TAG("DRAW_OBJ");
29 :
30 0 : void DrawObjectsLogger::beginObject(const std::string& name)
31 : {
32 0 : m_objects.push(name);
33 0 : std::string gap;
34 0 : gap.resize(m_objects.size());
35 : #ifdef LOG_STREAM
36 0 : LOG_STREAM(muse::logger::Logger::DEBG, DRAW_OBJ_TAG, muse::logger::Color::None)() << "Begin: " << gap << name;
37 : #else
38 : UNUSED(pagePos);
39 : #endif
40 0 : }
41 :
42 0 : void DrawObjectsLogger::endObject()
43 : {
44 0 : IF_ASSERT_FAILED(!m_objects.empty()) {
45 0 : return;
46 : }
47 :
48 0 : std::string gap;
49 0 : gap.resize(m_objects.size());
50 : #ifdef LOG_STREAM
51 0 : LOG_STREAM(muse::logger::Logger::DEBG, DRAW_OBJ_TAG, muse::logger::Color::None)() << "End: " << gap << m_objects.top();
52 : #endif
53 :
54 0 : m_objects.pop();
55 0 : }
|