refs #316 Removed old logging mechanism in contexts.

This commit is contained in:
Mathew Sutcliffe
2014-09-25 21:19:08 +01:00
parent d7a2fa3dea
commit b1c74d81e5
13 changed files with 2 additions and 653 deletions

View File

@@ -42,16 +42,6 @@ namespace BlackCore
IContextApplication(CRuntimeConfig::ContextMode mode, CRuntime *runtime);
public:
//! What output to redirect
enum RedirectionLevel : uint
{
RedirectNone,
RedirectAllOutput,
RedirectWarningAndAbove,
RedirectError
};
//! Components
enum Component : uint
{
@@ -92,25 +82,6 @@ namespace BlackCore
//! Destructor
virtual ~IContextApplication() {}
//! Output redirection (redirect my output)
//! \threadsafe
RedirectionLevel getOutputRedirectionLevel() const;
//! Output redirection (redirect my output)
//! \threadsafe
void setOutputRedirectionLevel(RedirectionLevel redirectionLevel);
//! Redirected output generated by others
//! \threadsafe
RedirectionLevel getStreamingForRedirectedOutputLevel() const;
//! Redirected output generated by others
//! \threadsafe
void setStreamingForRedirectedOutputLevel(RedirectionLevel redirectionLevel) ;
//! Reset output redirection
static void resetOutputRedirection();
signals:
//! \brief Status message
//! \remarks not to be called directly, use IContextApplication::sendStatusMessage
@@ -120,11 +91,6 @@ namespace BlackCore
//! \remarks not to be called directly, use IContextApplication::sendStatusMessage(s)
void statusMessages(const BlackMisc::CStatusMessageList &messages);
//! Redirect output streams as by qDebug(), qWarning(), qCritical()
//! \remarks context id is an important means to avoid infinite redirect loops
//! never output redirected stream messages from the same context again
void redirectedOutput(const BlackMisc::CStatusMessage &message, qint64 contextId);
//! A component changes
void componentChanged(uint component, uint action);
@@ -161,28 +127,13 @@ namespace BlackCore
void changeSettings(uint typeValue);
private:
//! All contexts, used with messageHandler
static QList<IContextApplication *> s_contexts;
//! Previous message handler
static QtMessageHandler s_oldHandler;
//! Message handler, handles one individual context
//! \threadsafe
void messageHandler(QtMsgType type, const QMessageLogContext &messageContext, const QString &messsage);
//! Handle output dispatch, handles all contexts
//! \threadsafe
static void messageHandlerDispatch(QtMsgType type, const QMessageLogContext &messageContext, const QString &message);
RedirectionLevel m_outputRedirectionLevel; //!< enable / disable my output
RedirectionLevel m_redirectedOutputRedirectionLevel; //!< enable / disable others' output
mutable QReadWriteLock m_lock; //!< thread safety
private slots:
//! Re-stream the redirected output
void streamRedirectedOutput(const BlackMisc::CStatusMessage &message, qint64 contextId);
};
}