diff options
Diffstat (limited to 'src/components/qt_hmi/qml_plugins/log4cxx')
-rw-r--r-- | src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc | 78 | ||||
-rw-r--r-- | src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h | 23 |
2 files changed, 51 insertions, 50 deletions
diff --git a/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc b/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc index da863e2e26..8b7efe23d7 100644 --- a/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc +++ b/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc @@ -37,58 +37,58 @@ #include <log4cxx/log4cxx.h> #include <log4cxx/propertyconfigurator.h> -log4cxx::LoggerPtr logger_ = log4cxx::LoggerPtr( - log4cxx::Logger::getLogger("Log4cxxPlugin")); +log4cxx::LoggerPtr logger_ = + log4cxx::LoggerPtr(log4cxx::Logger::getLogger("Log4cxxPlugin")); #if QT_4 -void smartLogger(QtMsgType type, const char *msg) { +void smartLogger(QtMsgType type, const char* msg) { log4cxx::spi::LocationInfo location("", "", -1); switch (type) { - case QtDebugMsg: - (*logger_).debug(msg, location); - break; - case QtWarningMsg: - (*logger_).warn(msg, location); - break; - case QtCriticalMsg: - (*logger_).error(msg, location); - break; - case QtFatalMsg: - (*logger_).fatal(msg, location); - break; - default: - (*logger_).info(msg, location); - break; + case QtDebugMsg: + (*logger_).debug(msg, location); + break; + case QtWarningMsg: + (*logger_).warn(msg, location); + break; + case QtCriticalMsg: + (*logger_).error(msg, location); + break; + case QtFatalMsg: + (*logger_).fatal(msg, location); + break; + default: + (*logger_).info(msg, location); + break; } } #elif QT_5 -void smartLogger(QtMsgType type, const QMessageLogContext &context, - const QString &msg) { - log4cxx::spi::LocationInfo location(context.file, - context.function ? context.function : "", - context.line); +void smartLogger(QtMsgType type, + const QMessageLogContext& context, + const QString& msg) { + log4cxx::spi::LocationInfo location( + context.file, context.function ? context.function : "", context.line); switch (type) { - case QtDebugMsg: - (*logger_).debug(msg.toStdString(), location); - break; - case QtWarningMsg: - (*logger_).warn(msg.toStdString(), location); - break; - case QtCriticalMsg: - (*logger_).error(msg.toStdString(), location); - break; - case QtFatalMsg: - (*logger_).fatal(msg.toStdString(), location); - break; - default: - (*logger_).info(msg.toStdString(), location); - break; + case QtDebugMsg: + (*logger_).debug(msg.toStdString(), location); + break; + case QtWarningMsg: + (*logger_).warn(msg.toStdString(), location); + break; + case QtCriticalMsg: + (*logger_).error(msg.toStdString(), location); + break; + case QtFatalMsg: + (*logger_).fatal(msg.toStdString(), location); + break; + default: + (*logger_).info(msg.toStdString(), location); + break; } } #endif // QT_VERSION -void Log4cxxPlugin::registerTypes(const char *uri) { +void Log4cxxPlugin::registerTypes(const char* uri) { log4cxx::PropertyConfigurator::configure("log4cxx.properties"); #if QT_4 diff --git a/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h b/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h index fc82352f0c..e8d1ff3347 100644 --- a/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h +++ b/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h @@ -37,19 +37,21 @@ #include <qglobal.h> -#define QT_4 ((QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)) && \ - (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))) +#define QT_4 \ + ((QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)) && \ + (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))) -#define QT_5 ((QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) && \ - (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))) +#define QT_5 \ + ((QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) && \ + (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))) #if QT_4 -# include <QtDeclarative/qdeclarative.h> -# include <QtDeclarative/QDeclarativeExtensionPlugin> +#include <QtDeclarative/qdeclarative.h> +#include <QtDeclarative/QDeclarativeExtensionPlugin> typedef QDeclarativeExtensionPlugin ExtensionPlugin; #elif QT_5 -# include <QtQml/qqml.h> -# include <QtQml/QQmlExtensionPlugin> +#include <QtQml/qqml.h> +#include <QtQml/QQmlExtensionPlugin> typedef QQmlExtensionPlugin ExtensionPlugin; #endif // QT_VERSION @@ -58,7 +60,7 @@ class Logger : public QObject { Q_DISABLE_COPY(Logger) public: - explicit Logger(QObject *parent = 0) : QObject(parent) {} + explicit Logger(QObject* parent = 0) : QObject(parent) {} }; class Log4cxxPlugin : public ExtensionPlugin { @@ -68,10 +70,9 @@ class Log4cxxPlugin : public ExtensionPlugin { #endif // QT_5 public: - void registerTypes(const char *uri); + void registerTypes(const char* uri); }; QML_DECLARE_TYPE(Logger) #endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_LOG4CXX_LOG4CXX_PLUGIN_H_ - |