diff options
| author | Tomasz Sterna <tomek@xiaoka.com> | 2014-07-14 17:19:45 +0200 |
|---|---|---|
| committer | Tomasz Sterna <tomek@xiaoka.com> | 2014-07-16 00:07:28 +0200 |
| commit | 3c19406ee292e0ed7993bd4d3976cc34d40e2f22 (patch) | |
| tree | 67d185e95d647e56c074f4b3a30ac4f0d81e2ee6 /ext/Log4Qt/src/varia | |
| parent | 630cc2e3097f2236a4c1191be6c955ec523d6f1a (diff) | |
Replaced ext/Log4Qt source with submodule
Diffstat (limited to 'ext/Log4Qt/src/varia')
| -rwxr-xr-x | ext/Log4Qt/src/varia/debugappender.cpp | 130 | ||||
| -rwxr-xr-x | ext/Log4Qt/src/varia/debugappender.h | 133 | ||||
| -rwxr-xr-x | ext/Log4Qt/src/varia/denyallfilter.cpp | 77 | ||||
| -rwxr-xr-x | ext/Log4Qt/src/varia/denyallfilter.h | 105 | ||||
| -rwxr-xr-x | ext/Log4Qt/src/varia/levelmatchfilter.cpp | 100 | ||||
| -rwxr-xr-x | ext/Log4Qt/src/varia/levelmatchfilter.h | 137 | ||||
| -rwxr-xr-x | ext/Log4Qt/src/varia/levelrangefilter.cpp | 104 | ||||
| -rwxr-xr-x | ext/Log4Qt/src/varia/levelrangefilter.h | 153 | ||||
| -rwxr-xr-x | ext/Log4Qt/src/varia/listappender.cpp | 153 | ||||
| -rwxr-xr-x | ext/Log4Qt/src/varia/listappender.h | 174 | ||||
| -rwxr-xr-x | ext/Log4Qt/src/varia/nullappender.cpp | 104 | ||||
| -rwxr-xr-x | ext/Log4Qt/src/varia/nullappender.h | 102 | ||||
| -rwxr-xr-x | ext/Log4Qt/src/varia/stringmatchfilter.cpp | 101 | ||||
| -rwxr-xr-x | ext/Log4Qt/src/varia/stringmatchfilter.h | 133 |
14 files changed, 0 insertions, 1706 deletions
diff --git a/ext/Log4Qt/src/varia/debugappender.cpp b/ext/Log4Qt/src/varia/debugappender.cpp deleted file mode 100755 index c77ee33..0000000 --- a/ext/Log4Qt/src/varia/debugappender.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/****************************************************************************** - * - * package: Log4Qt - * file: debugappender.cpp - * created: September 2007 - * author: Martin Heinrich - * - * - * Copyright 2007 Martin Heinrich - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ - - - -/****************************************************************************** - * Dependencies - ******************************************************************************/ - - -#include "varia/debugappender.h" - -#include <QtCore/QDebug> -#include <iostream> - -#include "layout.h" -#include "loggingevent.h" - -#if defined(Q_OS_WIN32) -#include <windows.h> -#endif - - -namespace Log4Qt -{ - - - /************************************************************************** - * Declarations - **************************************************************************/ - - - - /************************************************************************** - * C helper functions - **************************************************************************/ - - - - /************************************************************************** - * Class implementation: DebugAppender - **************************************************************************/ - - - DebugAppender::DebugAppender(Layout *pLayout, - QObject *pParent) : - AppenderSkeleton(pParent) - { - setLayout(pLayout); - } - - - bool DebugAppender::requiresLayout() const - { - return true; - } - - - void DebugAppender::append(const LoggingEvent &rEvent) - { - // Q_ASSERT_X(, "DebugAppender::append()", "Lock must be held by caller"); - Q_ASSERT_X(layout(), "DebugAppender::append()", "Layout must not be null"); - - QString message(layout()->format(rEvent)); -#if defined(Q_OS_WIN32) -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QT_WA({ - OutputDebugStringW(reinterpret_cast<const WCHAR*>(message.utf16())); - }, { - OutputDebugStringA(message.toLocal8Bit().data()); - }); -#else - OutputDebugStringW(reinterpret_cast<const WCHAR*>(message.utf16())); -#endif -#else - std::cerr << message.toLocal8Bit().constData() << std::endl; - std::cerr << std::flush; -#endif - } - - - - /************************************************************************** - * Implementation: Operators, Helper - **************************************************************************/ - - -#ifndef QT_NO_DEBUG_STREAM - QDebug DebugAppender::debug(QDebug &rDebug) const - { - QString layout_name; - if (layout()) - layout_name = layout()->name(); - - rDebug.nospace() << "DebugAppender(" - << "name:" << name() << " " - << "filter:" << firstFilter() << " " - << "isactive:" << isActive() << " " - << "isclosed:" << isClosed() << " " - << "layout:" << layout_name << " " - << "referencecount:" << referenceCount() << " " - << "threshold:" << threshold().toString() - << ")"; - return rDebug.space(); - } -#endif // QT_NO_DEBUG_STREAM - - -} // namspace Log4Qt diff --git a/ext/Log4Qt/src/varia/debugappender.h b/ext/Log4Qt/src/varia/debugappender.h deleted file mode 100755 index 4df6c02..0000000 --- a/ext/Log4Qt/src/varia/debugappender.h +++ /dev/null @@ -1,133 +0,0 @@ -/****************************************************************************** - * - * package: Log4Qt - * file: debugappender.h - * created: September 2007 - * author: Martin Heinrich - * - * - * Copyright 2007 Martin Heinrich - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ - -#ifndef LOG4QT_DEBUGAPPENDER_H -#define LOG4QT_DEBUGAPPENDER_H - - -/****************************************************************************** - * Dependencies - ******************************************************************************/ - -#include "appenderskeleton.h" - - -/****************************************************************************** - * Declarations - ******************************************************************************/ - -namespace Log4Qt -{ - - /*! - * \brief The class DebugAppender appends logging events to the platform - * specific debug output. - * - * A DebugAppender appends to the Debugger on Windows and to stderr on all - * other systems. - * - * \note All the functions declared in this class are thread-safe. - * - * \note The ownership and lifetime of objects of this class are managed. - * See \ref Ownership "Object ownership" for more details. - */ - class LOG4QT_EXPORT DebugAppender : public AppenderSkeleton - { - Q_OBJECT - - public: - /*! - * Creates a DebugAppender. - */ - DebugAppender(QObject *pParent = 0); - - /*! - * Creates a DebugAppender with the specified layout \a pLayout - */ - DebugAppender(Layout *pLayout, - QObject *pParent = 0); - - // virtual ~DebugAppender(); // Use compiler default - private: - DebugAppender(const DebugAppender &rOther); // Not implemented - DebugAppender &operator=(const DebugAppender &rOther); // Not implemented - - public: - /*! - * The DebugAppended requires a layout. The function returns true. - * - * \sa setLayout() - */ - virtual bool requiresLayout() const; - - protected: - /*! - * Appends the specified logging event \a rEvent to the debug output. - * The output is formatted using the appender's layout. - * - * The method is called by the AppenderSkeleton::doAppend() after it - * the entry conditions have been tested and it has been found that the - * logging event needs to be appended. - * - * \sa setLayout(), AppenderSkeleton::doAppend(), checkEntryConditions() - */ - virtual void append(const LoggingEvent &rEvent); - -#ifndef QT_NO_DEBUG_STREAM - /*! - * Writes all object member variables to the given debug stream \a rDebug - * and returns the stream. - * - * <tt> - * %DebugAppender(name:"DA" filter:0x3bee6b8 isactive:true isclosed:false - * layout:"SL" referencecount:1 threshold:"NULL") - * </tt> - * \sa QDebug, operator<<(QDebug debug, const LogObject &rLogObject) - */ - virtual QDebug debug(QDebug &rDebug) const; -#endif // QT_NO_DEBUG_STREAM - }; - - - /************************************************************************** - * Operators, Helper - **************************************************************************/ - - - /************************************************************************** - * Inline - **************************************************************************/ - - inline DebugAppender::DebugAppender(QObject *pParent) : - AppenderSkeleton(pParent) - {} - - -} // namespace Log4Qt - - -// Q_DECLARE_TYPEINFO(Log4Qt::DebugAppender, Q_COMPLEX_TYPE); // Use default - - -#endif // LOG4QT_DEBUGAPPENDER_H diff --git a/ext/Log4Qt/src/varia/denyallfilter.cpp b/ext/Log4Qt/src/varia/denyallfilter.cpp deleted file mode 100755 index 2a7bd1f..0000000 --- a/ext/Log4Qt/src/varia/denyallfilter.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/****************************************************************************** - * - * package: Log4Qt - * file: denyallfilter.cpp - * created: September 2007 - * author: Martin Heinrich - * - * - * Copyright 2007 Martin Heinrich - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ - - - -/****************************************************************************** - * Dependencies - ******************************************************************************/ - - -#include "varia/denyallfilter.h" - -#include <QtCore/QDebug> - - -namespace Log4Qt -{ - - - /************************************************************************** - * Declarations - **************************************************************************/ - - - - /************************************************************************** - * C helper functions - **************************************************************************/ - - - - /************************************************************************** - * Class implementation: Filter - **************************************************************************/ - - -#ifndef QT_NO_DEBUG_STREAM - QDebug DenyAllFilter::debug(QDebug &rDebug) const - { - rDebug.nospace() << "DenyAllFilter(" - << "next:" << next() - << "referencecount:" << referenceCount() << " " - << ")"; - return rDebug.space(); - } -#endif // QT_NO_DEBUG_STREAM - - - - /************************************************************************** - * Implementation: Operators, Helper - **************************************************************************/ - - - -} // namespace Log4Qt diff --git a/ext/Log4Qt/src/varia/denyallfilter.h b/ext/Log4Qt/src/varia/denyallfilter.h deleted file mode 100755 index 2106542..0000000 --- a/ext/Log4Qt/src/varia/denyallfilter.h +++ /dev/null @@ -1,105 +0,0 @@ -/****************************************************************************** - * - * package: Log4Qt - * file: denyallfilter.h - * created: September 2007 - * author: Martin Heinrich - * - * - * changes Feb 2009, Martin Heinrich - * - Fixed a compile error on VS 2008 by using Q_UNUSED(&rEvent) - * instead of Q_UNUSED(rEvent) - * - * - * Copyright 2007 - 2009 Martin Heinrich - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ - -#ifndef LOG4QT_DENYALLFILTER_H -#define LOG4QT_DENYALLFILTER_H - - -/****************************************************************************** - * Dependencies - ******************************************************************************/ - -#include "spi/filter.h" - - -/****************************************************************************** - * Declarations - ******************************************************************************/ - -namespace Log4Qt -{ - - /*! - * \brief The class DenyAllFilter drops all logging events - * - * \note The ownership and lifetime of objects of this class are managed. - * See \ref Ownership "Object ownership" for more details. - */ - class LOG4QT_EXPORT DenyAllFilter : public Filter - { - Q_OBJECT - - public: - DenyAllFilter(QObject *pParent = 0); - // DenyAllFilter(const DenyAllFilter &rOther); // Use compiler default - // virtual ~DenyAllFilter(); // Use compiler default - // DenyAllFilter &operator=(const DenyAllFilter &rOther); // Use compiler default - - virtual Decision decide(const LoggingEvent &rEvent) const; - - protected: -#ifndef QT_NO_DEBUG_STREAM - /*! - * Writes all object member variables to the given debug stream \a rDebug - * and returns the stream. - * - * <tt> - * %DenyAllFilter(next:QObject(0x0) referencecount:1 ) - * </tt> - * \sa QDebug, operator<<(QDebug debug, const LogObject &rLogObject) - */ - virtual QDebug debug(QDebug &rDebug) const; -#endif // QT_NO_DEBUG_STREAM - }; - - - /************************************************************************* - * Operators, Helper - *************************************************************************/ - - - /************************************************************************* - * Inline - *************************************************************************/ - - inline DenyAllFilter::DenyAllFilter(QObject *pParent) : - Filter(pParent) - {} - - inline Filter::Decision DenyAllFilter::decide(const LoggingEvent &rEvent) const - { Q_UNUSED(&rEvent); return Filter::DENY; } - - -} // namespace Log4Qt - - -// Q_DECLARE_TYPEINFO(Log4Qt::DenyAllFilter, Q_MOVABLE_TYPE); // Use default - - -#endif // LOG4QT_DENYALLFILTER_H diff --git a/ext/Log4Qt/src/varia/levelmatchfilter.cpp b/ext/Log4Qt/src/varia/levelmatchfilter.cpp deleted file mode 100755 index 6b5a815..0000000 --- a/ext/Log4Qt/src/varia/levelmatchfilter.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/****************************************************************************** - * - * package: Log4Qt - * file: levelmatchfilter.cpp - * created: September 2007 - * author: Martin Heinrich - * - * - * Copyright 2007 Martin Heinrich - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ - - - -/****************************************************************************** - * Dependencies - ******************************************************************************/ - - -#include "varia/levelmatchfilter.h" - -#include <QtCore/QDebug> -#include "loggingevent.h" - - -namespace Log4Qt -{ - - - /************************************************************************** - * Declarations - **************************************************************************/ - - - - /************************************************************************** - * C helper functions - **************************************************************************/ - - - - /************************************************************************** - * Class implementation: Filter - **************************************************************************/ - - - LevelMatchFilter::LevelMatchFilter(QObject *pParent) : - Filter(pParent), - mAcceptOnMatch(true), - mLevelToMatch(Level::NULL_INT) - {} - - - Filter::Decision LevelMatchFilter::decide(const LoggingEvent &rEvent) const - { - if (mLevelToMatch == Level::NULL_INT || - rEvent.level() != mLevelToMatch) - return Filter::NEUTRAL; - - if (mAcceptOnMatch) - return Filter::ACCEPT; - else - return Filter::DENY; - } - - -#ifndef QT_NO_DEBUG_STREAM - QDebug LevelMatchFilter::debug(QDebug &rDebug) const - { - rDebug.nospace() << "LevelMatchFilter(" - << "acceptonmatch:" << mAcceptOnMatch << " " - << "leveltomatch:" << mLevelToMatch.toString() << " " - << "next:" << next() - << "referencecount:" << referenceCount() << " " - << ")"; - return rDebug.space(); - } -#endif // QT_NO_DEBUG_STREAM - - - - /************************************************************************** - * Implementation: Operators, Helper - **************************************************************************/ - - - -} // namespace Log4Qt diff --git a/ext/Log4Qt/src/varia/levelmatchfilter.h b/ext/Log4Qt/src/varia/levelmatchfilter.h deleted file mode 100755 index f74c64b..0000000 --- a/ext/Log4Qt/src/varia/levelmatchfilter.h +++ /dev/null @@ -1,137 +0,0 @@ -/****************************************************************************** - * - * package: Log4Qt - * file: levelmatchfilter.h - * created: September 2007 - * author: Martin Heinrich - * - * - * Copyright 2007 Martin Heinrich - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ - -#ifndef LOG4QT_LEVELMATCHFILTER_H -#define LOG4QT_LEVELMATCHFILTER_H - - -/****************************************************************************** - * Dependencies - ******************************************************************************/ - -#include "spi/filter.h" - -#include "level.h" - - -/****************************************************************************** - * Declarations - ******************************************************************************/ - -namespace Log4Qt -{ - - /*! - * \brief The class LevelMatchFilter allows logging events with a specified - * level. - * - * \note The ownership and lifetime of objects of this class are managed. - * See \ref Ownership "Object ownership" for more details. - */ - class LOG4QT_EXPORT LevelMatchFilter : public Filter - { - Q_OBJECT - - /*! - * The property holds if an event is accpeted on a match. - * - * The default is true. - * - * \sa acceptOnMatch(), setAcceptOnMatch() - */ - Q_PROPERTY(bool acceptOnMatch READ acceptOnMatch WRITE setAcceptOnMatch) - - /*! - * The property holds the level to match for this filter. - * - * The default is Level::NULL_INT. - * - * \sa levelToMatch(), setLevelToMatch() - */ - Q_PROPERTY(Log4Qt::Level levelToMatch READ levelToMatch WRITE setLevelToMatch) - - public: - LevelMatchFilter(QObject *pParent = 0); - // LevelMatchFilter(const LevelMatchFilter &rOther); // Use compiler default - // virtual ~LevelMatchFilter(); // Use compiler default - // LevelMatchFilter &operator=(const LevelMatchFilter &rOther); // Use compiler default - - bool acceptOnMatch() const; - Level levelToMatch() const; - void setAcceptOnMatch(bool accept); - void setLevelToMatch(Level level); - - virtual Decision decide(const LoggingEvent &rEvent) const; - - protected: -#ifndef QT_NO_DEBUG_STREAM - /*! - * Writes all object member variables to the given debug stream \a rDebug - * and returns the stream. - * - * <tt> - * %LevelMatchFilter(acceptonmatch:true leveltomatch:"WARN" - * next:Log4Qt::DenyAllFilter(0x3bce3a8) - * referencecount:1 ) - * </tt> - * \sa QDebug, operator<<(QDebug debug, const LogObject &rLogObject) - */ - virtual QDebug debug(QDebug &rDebug) const; -#endif // QT_NO_DEBUG_STREAM - - private: - bool mAcceptOnMatch; - Level mLevelToMatch; - }; - - - /************************************************************************** - * Operators, Helper - **************************************************************************/ - - - /************************************************************************** - * Inline - **************************************************************************/ - - inline bool LevelMatchFilter::acceptOnMatch() const - { return mAcceptOnMatch; } - - inline Level LevelMatchFilter::levelToMatch() const - { return mLevelToMatch; } - - inline void LevelMatchFilter::setAcceptOnMatch(bool accept) - { mAcceptOnMatch = accept; } - - inline void LevelMatchFilter::setLevelToMatch(Level level) - { mLevelToMatch = level; } - - -} // namespace Log4Qt - - -// Q_DECLARE_TYPEINFO(Log4Qt::LevelMatchFilter, Q_MOVABLE_TYPE); // Use default - - -#endif // LOG4QT_LEVELMATCHFILTER_H diff --git a/ext/Log4Qt/src/varia/levelrangefilter.cpp b/ext/Log4Qt/src/varia/levelrangefilter.cpp deleted file mode 100755 index 73f42c5..0000000 --- a/ext/Log4Qt/src/varia/levelrangefilter.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/****************************************************************************** - * - * package: Log4Qt - * file: levelrangefilter.cpp - * created: September 2007 - * author: Martin Heinrich - * - * - * Copyright 2007 Martin Heinrich - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ - - - -/****************************************************************************** - * Dependencies - ******************************************************************************/ - - -#include "varia/levelrangefilter.h" - -#include <QtCore/QDebug> -#include "loggingevent.h" - - -namespace Log4Qt -{ - - -/****************************************************************************** - * Declarations - ******************************************************************************/ - - - -/****************************************************************************** - * C helper functions - ******************************************************************************/ - - - -/****************************************************************************** - * Class implementation: Filter - ******************************************************************************/ - - -LevelRangeFilter::LevelRangeFilter(QObject *pParent) : - Filter(pParent), - mAcceptOnMatch(true), - mLevelMin(Level::NULL_INT), - mLevelMax(Level::OFF_INT) -{} - - -Filter::Decision LevelRangeFilter::decide(const LoggingEvent &rEvent) const -{ - if (rEvent.level() < mLevelMin) - return Filter::DENY; - - if (rEvent.level() > mLevelMax) - return Filter::DENY; - - if (mAcceptOnMatch) - return Filter::ACCEPT; - else - return Filter::NEUTRAL; -} - - -#ifndef QT_NO_DEBUG_STREAM -QDebug LevelRangeFilter::debug(QDebug &rDebug) const -{ - rDebug.nospace() << "LevelRangeFilter(" - << "acceptonmatch:" << mAcceptOnMatch << " " - << "levelmin:" << mLevelMin.toString() << " " - << "levelmax:" << mLevelMax.toString() << " " - << "next:" << next() - << "referencecount:" << referenceCount() << " " - << ")"; - return rDebug.space(); -} -#endif // QT_NO_DEBUG_STREAM - - - -/****************************************************************************** - * Implementation: Operators, Helper - ******************************************************************************/ - - - -} // namespace Log4Qt diff --git a/ext/Log4Qt/src/varia/levelrangefilter.h b/ext/Log4Qt/src/varia/levelrangefilter.h deleted file mode 100755 index e148d9c..0000000 --- a/ext/Log4Qt/src/varia/levelrangefilter.h +++ /dev/null @@ -1,153 +0,0 @@ -/****************************************************************************** - * - * package: Log4Qt - * file: levelrangefilter.h - * created: September 2007 - * author: Martin Heinrich - * - * - * Copyright 2007 Martin Heinrich - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ - -#ifndef LOG4QT_LEVELRANGEFILTER_H -#define LOG4QT_LEVELRANGEFILTER_H - - -/****************************************************************************** - * Dependencies - ******************************************************************************/ - -#include "spi/filter.h" - -#include "level.h" - - -/****************************************************************************** - * Declarations - ******************************************************************************/ - -namespace Log4Qt -{ - - /*! - * \brief The class LevelMatchFilter allows logging events with levels in a - * specified range. - * - * \note The ownership and lifetime of objects of this class are managed. - * See \ref Ownership "Object ownership" for more details. - */ - class LOG4QT_EXPORT LevelRangeFilter : public Filter - { - Q_OBJECT - - /*! - * The property holds if an event is accpeted on a match. - * - * The default is true. - * - * \sa acceptOnMatch(), acceptOnMatch() - */ - Q_PROPERTY(bool acceptOnMatch READ acceptOnMatch WRITE setAcceptOnMatch) - - /*! - * The property holds the maximum level of the range for this filter. - * - * The default is Level::OFF_INT. - * - * \sa levelMax(), setLevelMax() - */ - Q_PROPERTY(Log4Qt::Level levelMax READ levelMax WRITE setLevelMax) - - /*! - * The property holds the minimum level of the range for this filter. - * - * The default is Level::NULL_INT. - * - * \sa levelMin(), setLevelMin() - */ - Q_PROPERTY(Log4Qt::Level levelMin READ levelMin WRITE setLevelMin) - - public: - LevelRangeFilter(QObject *pParent = 0); - // LevelRangeFilter(const LevelRangeFilter &rOther); // Use compiler default - // virtual ~LevelRangeFilter(); // Use compiler default - // LevelRangeFilter &operator=(const LevelRangeFilter &rOther); // Use compiler default - - bool acceptOnMatch() const; - Level levelMax() const; - Level levelMin() const; - void setAcceptOnMatch(bool accept); - void setLevelMax(Level level); - void setLevelMin(Level level); - - virtual Decision decide(const LoggingEvent &rEvent) const; - - protected: - /*! - * Writes all object member variables to the given debug stream \a rDebug - * and returns the stream. - * - * <tt> - * %LevelRangeFilter(acceptonmatch:true levelmin:"ERROR" levelmax:"FATAL" - * next:Log4Qt::LevelMatchFilter(0x3bcd960) - * referencecount:1 ) - * </tt> - * \sa QDebug, operator<<(QDebug debug, const LogObject &rLogObject) - */ - virtual QDebug debug(QDebug &rDebug) const; - - private: - bool mAcceptOnMatch; - Level mLevelMin; - Level mLevelMax; - }; - - - /************************************************************************** - * Operators, Helper - **************************************************************************/ - - - /************************************************************************** - * Inline - **************************************************************************/ - - inline bool LevelRangeFilter::acceptOnMatch() const - { return mAcceptOnMatch; } - - inline Level LevelRangeFilter::levelMax() const - { return mLevelMax; } - - inline Level LevelRangeFilter::levelMin() const - { return mLevelMin; } - - inline void LevelRangeFilter::setAcceptOnMatch(bool accept) - { mAcceptOnMatch = accept; } - - inline void LevelRangeFilter::setLevelMax(Level level) - { mLevelMax = level; } - - inline void LevelRangeFilter::setLevelMin(Level level) - { mLevelMin = level; } - - -} // namespace Log4Qt - - -// Q_DECLARE_TYPEINFO(Log4Qt::LevelRangeFilter, Q_MOVABLE_TYPE); // Use default - - -#endif // LOG4QT_LEVELRANGEFILTER_H diff --git a/ext/Log4Qt/src/varia/listappender.cpp b/ext/Log4Qt/src/varia/listappender.cpp deleted file mode 100755 index 6b8aa39..0000000 --- a/ext/Log4Qt/src/varia/listappender.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/****************************************************************************** - * - * package: Log4Qt - * file: listappender.cpp - * created: September 2007 - * author: Martin Heinrich - * - * - * Copyright 2007 Martin Heinrich - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ - - - -/****************************************************************************** - * Dependencies - ******************************************************************************/ - - -#include "varia/listappender.h" - -#include <QtCore/QDebug> - - - -namespace Log4Qt -{ - - - /************************************************************************** - * Declarations - **************************************************************************/ - - - - /************************************************************************** - * C helper functions - **************************************************************************/ - - - - /************************************************************************** - * Class implementation: ListAppender - **************************************************************************/ - - - ListAppender::ListAppender(QObject *pParent) : - AppenderSkeleton(pParent), - mConfiguratorList(false), - mList(), - mMaxCount(0) - { - } - - - ListAppender::~ListAppender() - { - } - - - QList<LoggingEvent> ListAppender::list() const - { - QMutexLocker locker(&mObjectGuard); - - return mList; - } - - - void ListAppender::setMaxCount(int n) - { - QMutexLocker locker(&mObjectGuard); - - if (n < 0) - { - logger()->warn("Attempt to set maximum count for appender '%1' to %2. Using zero instead", name(), n); - n = 0; - } - mMaxCount = n; - ensureMaxCount(); - } - - - QList<LoggingEvent> ListAppender::clearList() - { - QMutexLocker locker(&mObjectGuard); - - QList<LoggingEvent> result = mList; - mList.clear(); - return result; - } - - - // bool ListAppender::requiresLayout() const; - - - void ListAppender::append(const LoggingEvent &rEvent) - { - // Q_ASSERT_X(, "ListAppender::append()", "Lock must be held by caller") - - if ((mMaxCount <= 0) || (mList.size() < mMaxCount)) - mList << rEvent; - } - - -#ifndef QT_NO_DEBUG_STREAM - QDebug ListAppender::debug(QDebug &rDebug) const - { - rDebug.nospace() << "ListAppender(" - << "name:" << name() << " " - << "count:" << list().count() << " " - << "filter:" << firstFilter() << " " - << "isactive:" << isActive() << " " - << "isclosed:" << isClosed() << " " - << "maxcount:" << maxCount() << " " - << "referencecount:" << referenceCount() << " " - << "threshold:" << threshold().toString() - << ")"; - return rDebug.space(); - } -#endif // QT_NO_DEBUG_STREAM - - - void ListAppender::ensureMaxCount() - { - // Q_ASSERT_X(, "ListAppender::ensureMaxCount()", "Lock must be held by caller") - - if (mMaxCount <= 0) - return; - - while (mList.size() > mMaxCount) - mList.removeFirst(); - } - - - - /************************************************************************** - * Implementation: Operators, Helper - **************************************************************************/ - - -} // namespace Log4Qt diff --git a/ext/Log4Qt/src/varia/listappender.h b/ext/Log4Qt/src/varia/listappender.h deleted file mode 100755 index f5e9df0..0000000 --- a/ext/Log4Qt/src/varia/listappender.h +++ /dev/null @@ -1,174 +0,0 @@ -/****************************************************************************** - * - * package: Log4Qt - * file: listappender.h - * created: September 2007 - * author: Martin Heinrich - * - * - * Copyright 2007 Martin Heinrich - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ - -#ifndef LOG4QT_LISTAPPENDER_H -#define LOG4QT_LISTAPPENDER_H - - -/****************************************************************************** - * Dependencies - ******************************************************************************/ - -#include "appenderskeleton.h" - -#include <QtCore/QList> -#include <QtCore/QMutex> -#include "loggingevent.h" - - -/****************************************************************************** - * Declarations - ******************************************************************************/ - -namespace Log4Qt -{ - - /*! - * \brief The class ListAppender appends logging events to a list for later - * processing. - * - * \note All the functions declared in this class are thread-safe. - * - * \note The ownership and lifetime of objects of this class are managed. - * See \ref Ownership "Object ownership" for more details. - */ - class LOG4QT_EXPORT ListAppender : public AppenderSkeleton - { - Q_OBJECT - - /*! - * The property holds, if the Appender is used by a configurator. - * - * The default value is false for not being a configurator list. - * - * \sa configuratorList(), setConfiguratorList() - */ - Q_PROPERTY(bool configuratorList READ configuratorList WRITE setConfiguratorList) - - /*! - * The property holds the maximum count used by the appender. - * - * The default maximum count is -1 for unlimited. - * - * \sa maxCount(), setMaxCount() - */ - Q_PROPERTY(int maxCount READ maxCount WRITE setMaxCount) - - public: - ListAppender(QObject *pParent = 0); - virtual ~ListAppender(); - private: - ListAppender(const ListAppender &rOther); // Not implemented - ListAppender &operator=(const ListAppender &rOther); // Not implemented - - public: - /*! - * Returns true, if the appender is used by a configurator. Otherweise it returns - * false. - * - * \sa setConfiguratorList() - */ - bool configuratorList() const; - - QList<LoggingEvent> list() const; - int maxCount() const; - - /*! - * Sets that the appender is used by a configurator. If set to true, the appender - * will not be removed from a Logger when Logger::removeAllAppenders()is called. - * This way the appender can collect events raised during the configuration process. - * - * \sa configuratorList(), BasicConfigurator, PropertyConfigurator, - * ConfiguratorHelper::configureError() - */ - void setConfiguratorList(bool isConfiguratorList); - - void setMaxCount(int n); - - QList<LoggingEvent> clearList(); - virtual bool requiresLayout() const; - - protected: - virtual void append(const LoggingEvent &rEvent); - -#ifndef QT_NO_DEBUG_STREAM - /*! - * Writes all object member variables to the given debug stream - * \a rDebug and returns the stream. - * - * <tt> - * %ListAppender(name:"LA" count:1 filter:0x41fa488 isactive:true - * isclosed:false maxcount:170 referencecount:1 - * threshold:"TRACE_SET") - * </tt> - * \sa QDebug, operator<<(QDebug debug, const LogObject &rLogObject) - */ - virtual QDebug debug(QDebug &rDebug) const; -#endif // QT_NO_DEBUG_STREAM - - /*! - * Ensures that the count of events is less or equal then the maxium - * count. If the list contains too many items, items are deleted from - * the begin of the list. - */ - void ensureMaxCount(); - - private: - volatile bool mConfiguratorList; - QList<LoggingEvent> mList; - volatile int mMaxCount; - }; - - - /************************************************************************** - * Operators, Helper - **************************************************************************/ - - - /************************************************************************** - * Inline - **************************************************************************/ - - inline bool ListAppender::configuratorList() const - { // QMutexLocker locker(&mObjectGuard); // Read/Write of int is safe - return mConfiguratorList; } - - inline int ListAppender::maxCount() const - { return mMaxCount; } - - inline void ListAppender::setConfiguratorList(bool isConfiguratorList) - { // QMutexLocker locker(&mObjectGuard); // Read/Write of int is safe - mConfiguratorList = isConfiguratorList; } - - inline bool ListAppender::requiresLayout() const - { return false; } - - -} // namespace Log4Qt - - -// Q_DECLARE_TYPEINFO(Log4Qt::ListAppender, Q_COMPLEX_TYPE); // Use default - - -#endif // LOG4QT_LISTAPPENDER_H diff --git a/ext/Log4Qt/src/varia/nullappender.cpp b/ext/Log4Qt/src/varia/nullappender.cpp deleted file mode 100755 index ed190b6..0000000 --- a/ext/Log4Qt/src/varia/nullappender.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/****************************************************************************** - * - * package: Log4Qt - * file: nullappender.cpp - * created: September 2007 - * author: Martin Heinrich - * - * - * Copyright 2007 Martin Heinrich - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ - - - -/****************************************************************************** - * Dependencies - ******************************************************************************/ - - -#include "varia/nullappender.h" - -#include <QtCore/QDebug> -#include "layout.h" -#include "loggingevent.h" - - - -namespace Log4Qt -{ - - - /************************************************************************** - * Declarations - **************************************************************************/ - - - - /************************************************************************** - * C helper functions - **************************************************************************/ - - - - /************************************************************************** - * Class implementation: NullAppender - **************************************************************************/ - - - NullAppender::NullAppender(QObject *pParent) : - AppenderSkeleton(false, pParent) - { - } - - - NullAppender::~NullAppender() - { - close(); - } - - - void NullAppender::append(const LoggingEvent &rEvent) - { - Q_UNUSED(rEvent); - } - - -#ifndef QT_NO_DEBUG_STREAM - QDebug NullAppender::debug(QDebug &rDebug) const - { - QString layout_name; - if (layout()) - layout_name = layout()->name(); - - rDebug.nospace() << "NullAppender(" - << "name:" << name() << " " - << "isactive:" << isActive() << " " - << "isclosed:" << isClosed() << " " - << "layout:" << layout_name << " " - << "threshold:" << threshold().toString() << " " - << ")"; - return rDebug.space(); - } -#endif // QT_NO_DEBUG_STREAM - - - - /************************************************************************** - * Implementation: Operators, Helper - **************************************************************************/ - - -} // namespace Log4Qt diff --git a/ext/Log4Qt/src/varia/nullappender.h b/ext/Log4Qt/src/varia/nullappender.h deleted file mode 100755 index 102f71f..0000000 --- a/ext/Log4Qt/src/varia/nullappender.h +++ /dev/null @@ -1,102 +0,0 @@ -/****************************************************************************** - * - * package: Log4Qt - * file: nullappender.h - * created: September 2007 - * author: Martin Heinrich - * - * - * Copyright 2007 Martin Heinrich - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ - -#ifndef LOG4QT_NULLAPPENDER_H -#define LOG4QT_NULLAPPENDER_H - - -/****************************************************************************** - * Dependencies - ******************************************************************************/ - -#include "appenderskeleton.h" - - -/****************************************************************************** - * Declarations - ******************************************************************************/ - -namespace Log4Qt -{ - -/*! - * \brief The class NullAppender ignores all requests to append. - * - * \note All the functions declared in this class are thread-safe. - * - * \note The ownership and lifetime of objects of this class are managed. See - * \ref Ownership "Object ownership" for more details. - */ -class LOG4QT_EXPORT NullAppender : public AppenderSkeleton -{ - Q_OBJECT - -public: - NullAppender(QObject *pParent = 0); - virtual ~NullAppender(); -private: - NullAppender(const NullAppender &rOther); // Not implemented - NullAppender &operator=(const NullAppender &rOther); // Not implemented - -public: - virtual bool requiresLayout() const; - -protected: - virtual void append(const LoggingEvent &rEvent); - -#ifndef QT_NO_DEBUG_STREAM - /*! - * Writes all object member variables to the given debug stream \a rDebug and - * returns the stream. - * - * <tt> - * %NullAppender() - * </tt> - * \sa QDebug, operator<<(QDebug debug, const LogObject &rLogObject) - */ - virtual QDebug debug(QDebug &rDebug) const; -#endif // QT_NO_DEBUG_STREAM -}; - - -/****************************************************************************** - * Operators, Helper - ******************************************************************************/ - - -/****************************************************************************** - * Inline - ******************************************************************************/ - -inline bool NullAppender::requiresLayout() const -{ return false; } - - -} // namespace Log4Qt - - -// Q_DECLARE_TYPEINFO(Log4Qt::NullAppender, Q_COMPLEX_TYPE); // Use default - - -#endif // LOG4QT_NULLAPPENDER_H diff --git a/ext/Log4Qt/src/varia/stringmatchfilter.cpp b/ext/Log4Qt/src/varia/stringmatchfilter.cpp deleted file mode 100755 index cdc41d0..0000000 --- a/ext/Log4Qt/src/varia/stringmatchfilter.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/****************************************************************************** - * - * package: Log4Qt - * file: stringmatchfilter.cpp - * created: September 2007 - * author: Martin Heinrich - * - * - * Copyright 2007 Martin Heinrich - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ - - - -/****************************************************************************** - * Dependencies - ******************************************************************************/ - - -#include "varia/stringmatchfilter.h" - -#include <QtCore/QDebug> -#include "loggingevent.h" - - -namespace Log4Qt -{ - - - /************************************************************************** - * Declarations - **************************************************************************/ - - - - /************************************************************************** - * C helper functions - **************************************************************************/ - - - - /************************************************************************** - * Class implementation: Filter - **************************************************************************/ - - - StringMatchFilter::StringMatchFilter(QObject *pParent) : - Filter(pParent), - mAcceptOnMatch(true), - mStringToMatch() - {} - - - Filter::Decision StringMatchFilter::decide(const LoggingEvent &rEvent) const - { - if (rEvent.message().isEmpty() || - mStringToMatch.isEmpty() || - rEvent.message().indexOf(mStringToMatch) < 0) - return Filter::NEUTRAL; - - if (mAcceptOnMatch) - return Filter::ACCEPT; - else - return Filter::DENY; - } - - -#ifndef QT_NO_DEBUG_STREAM - QDebug StringMatchFilter::debug(QDebug &rDebug) const - { - rDebug.nospace() << "StringMatchFilter(" - << "acceptonmatch:" << mAcceptOnMatch << " " - << "referencecount:" << referenceCount() << " " - << "stringtomatch:" << mStringToMatch << " " - << "next:" << next() - << ")"; - return rDebug.space(); - } -#endif // QT_NO_DEBUG_STREAM - - - - /************************************************************************** - * Implementation: Operators, Helper - **************************************************************************/ - - - -} // namespace Log4Qt diff --git a/ext/Log4Qt/src/varia/stringmatchfilter.h b/ext/Log4Qt/src/varia/stringmatchfilter.h deleted file mode 100755 index eb2dac4..0000000 --- a/ext/Log4Qt/src/varia/stringmatchfilter.h +++ /dev/null @@ -1,133 +0,0 @@ -/****************************************************************************** - * - * package: Log4Qt - * file: stringmatchfilter.h - * created: September 2007 - * author: Martin Heinrich - * - * - * Copyright 2007 Martin Heinrich - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ - -#ifndef LOG4QT_STRINGMATCHFILTER_H -#define LOG4QT_STRINGMATCHFILTER_H - - -/****************************************************************************** - * Dependencies - ******************************************************************************/ - -#include "spi/filter.h" - - -/****************************************************************************** - * Declarations - ******************************************************************************/ - -namespace Log4Qt -{ - - /*! - * \brief The class StringMatchFilter allows logging events with a - * specified level. - * - * \note The ownership and lifetime of objects of this class are managed. - * See \ref Ownership "Object ownership" for more details. - */ - class LOG4QT_EXPORT StringMatchFilter : public Filter - { - Q_OBJECT - - /*! - * The property holds if an event is accpeted on a match. - * - * The default is true. - * - * \sa acceptOnMatch(), acceptOnMatch() - */ - Q_PROPERTY(bool acceptOnMatch READ acceptOnMatch WRITE setAcceptOnMatch) - - /*! - * The property holds the string to match for this filter. - * - * \sa stringToMatch(), setStringToMatch() - */ - Q_PROPERTY(QString stringToMatch READ stringToMatch WRITE setStringToMatch) - - public: - StringMatchFilter(QObject *pParent = 0); - // StringMatchFilter(const StringMatchFilter &rOther); // Use compiler default - // virtual ~StringMatchFilter(); // Use compiler default - // StringMatchFilter &operator=(const StringMatchFilter &rOther); // Use compiler default - - bool acceptOnMatch() const; - QString stringToMatch() const; - void setAcceptOnMatch(bool accept); - void setStringToMatch(const QString &rString); - - virtual Decision decide(const LoggingEvent &rEvent) const; - - protected: -#ifndef QT_NO_DEBUG_STREAM - /*! - * Writes all object member variables to the given debug stream - * \a rDebug and returns the stream. - * - * <tt> - * %StringMatchFilter(acceptonmatch:true referencecount:1 - * stringtomatch:"LDAP_STRONG_AUTH_REQUIRED" - * next:Log4Qt::LevelMatchFilter(0x3bdd960) ) - * </tt> - * \sa QDebug, operator<<(QDebug debug, const LogObject &rLogObject) - */ - virtual QDebug debug(QDebug &rDebug) const; -#endif // QT_NO_DEBUG_STREAM - - private: - bool mAcceptOnMatch; - QString mStringToMatch; - }; - - - /************************************************************************** - * Operators, Helper - **************************************************************************/ - - - /************************************************************************** - * Inline - **************************************************************************/ - - inline bool StringMatchFilter::acceptOnMatch() const - { return mAcceptOnMatch; } - - inline QString StringMatchFilter::stringToMatch() const - { return mStringToMatch; } - - inline void StringMatchFilter::setAcceptOnMatch(bool accept) - { mAcceptOnMatch = accept; } - - inline void StringMatchFilter::setStringToMatch(const QString &rString) - { mStringToMatch = rString; } - - -} // namespace Log4Qt - - -// Q_DECLARE_TYPEINFO(Log4Qt::StringMatchFilter, Q_MOVABLE_TYPE); // Use default - - -#endif // LOG4QT_STRINGMATCHFILTER_H |
