mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
refs #316 Removed old logging mechanism in contexts.
This commit is contained in:
@@ -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);
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user