| 1 |
// Copyright © 2016 Canonical Ltd. |
| 2 |
// Author: Loïc Molinari <[email protected]> |
| 3 |
// |
| 4 |
// This file is part of Lomiri UI Toolkit. |
| 5 |
// |
| 6 |
// Lomiri UI Toolkit is free software: you can redistribute it and/or modify it |
| 7 |
// under the terms of the GNU Lesser General Public License as published by the |
| 8 |
// Free Software Foundation; version 3. |
| 9 |
// |
| 10 |
// Lomiri UI Toolkit is distributed in the hope that it will be useful, but |
| 11 |
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 12 |
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License |
| 13 |
// for more details. |
| 14 |
// |
| 15 |
// You should have received a copy of the GNU Lesser General Public License |
| 16 |
// along with Lomiri UI Toolkit. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
|
| 18 |
#ifndef LOGGER_P_H |
| 19 |
#define LOGGER_P_H |
| 20 |
|
| 21 |
#include <QtGlobal> |
| 22 |
|
| 23 |
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) |
| 24 |
#include <LomiriMetrics-Qt6/logger.h> |
| 25 |
#else |
| 26 |
#include <LomiriMetrics/logger.h> |
| 27 |
#endif |
| 28 |
|
| 29 |
#include <QtCore/QFile> |
| 30 |
#include <QtCore/QTextStream> |
| 31 |
|
| 32 |
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) |
| 33 |
#include <LomiriMetrics-Qt6/events.h> |
| 34 |
#else |
| 35 |
#include <LomiriMetrics/events.h> |
| 36 |
#endif |
| 37 |
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) |
| 38 |
#include <LomiriMetrics-Qt6/private/lomirimetricsglobal_p.h> |
| 39 |
#else |
| 40 |
#include <LomiriMetrics/private/lomirimetricsglobal_p.h> |
| 41 |
#endif |
| 42 |
|
| 43 |
class LOMIRI_METRICS_PRIVATE_EXPORT UMFileLoggerPrivate |
| 44 |
{ |
| 45 |
public: |
| 46 |
enum { |
| 47 |
Open = (1 << 0), |
| 48 |
Colored = (1 << 1), |
| 49 |
Parsable = (1 << 2) |
| 50 |
}; |
| 51 |
|
| 52 |
UMFileLoggerPrivate(const QString& fileName, bool parsable); |
| 53 |
UMFileLoggerPrivate(FILE* fileHandle, bool parsable); |
| 54 |
|
| 55 |
void log(const UMEvent& event); |
| 56 |
|
| 57 |
QFile m_file; |
| 58 |
QTextStream m_textStream; |
| 59 |
quint8 m_flags; |
| 60 |
}; |
| 61 |
|
| 62 |
#endif // LOGGER_P_H |