mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-12 03:16:07 +08:00
merged 1.4 r982:983 into trunk
This commit is contained in:
@@ -189,9 +189,9 @@ CArch::showConsole(bool showIfEmpty)
|
||||
}
|
||||
|
||||
void
|
||||
CArch::writeConsole(const char* str)
|
||||
CArch::writeConsole(ELevel level, const char* str)
|
||||
{
|
||||
m_console->writeConsole(str);
|
||||
m_console->writeConsole(level, str);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
virtual void openConsole(const char*);
|
||||
virtual void closeConsole();
|
||||
virtual void showConsole(bool showIfEmpty);
|
||||
virtual void writeConsole(const char*);
|
||||
virtual void writeConsole(ELevel, const char*);
|
||||
|
||||
// IArchDaemon overrides
|
||||
virtual void installDaemon(const char* name,
|
||||
|
||||
@@ -16,12 +16,16 @@
|
||||
*/
|
||||
|
||||
#include "CArchConsoleStd.h"
|
||||
#include "CLog.h"
|
||||
#include <iostream>
|
||||
|
||||
void
|
||||
CArchConsoleStd::writeConsole(const char* str)
|
||||
CArchConsoleStd::writeConsole(ELevel level, const char* str)
|
||||
{
|
||||
// TODO: we need to use cerr also somehow
|
||||
std::cout << str << std::endl;
|
||||
if ((level >= kFATAL) && (level <= kWARNING))
|
||||
std::cerr << str << std::endl;
|
||||
else
|
||||
std::cout << str << std::endl;
|
||||
|
||||
std::cout.flush();
|
||||
}
|
||||
@@ -29,5 +29,5 @@ public:
|
||||
virtual void openConsole(const char* title) { }
|
||||
virtual void closeConsole() { }
|
||||
virtual void showConsole(bool) { }
|
||||
virtual void writeConsole(const char*);
|
||||
virtual void writeConsole(ELevel level, const char*);
|
||||
};
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#define IARCHCONSOLE_H
|
||||
|
||||
#include "IInterface.h"
|
||||
#include "ELevel.h"
|
||||
|
||||
//! Interface for architecture dependent console output
|
||||
/*!
|
||||
@@ -59,7 +60,7 @@ public:
|
||||
/*!
|
||||
Writes the given string to the console, opening it if necessary.
|
||||
*/
|
||||
virtual void writeConsole(const char*) = 0;
|
||||
virtual void writeConsole(ELevel, const char*) = 0;
|
||||
|
||||
//@}
|
||||
};
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#define IARCHLOG_H
|
||||
|
||||
#include "IInterface.h"
|
||||
#include "ELevel.h"
|
||||
|
||||
//! Interface for architecture dependent logging
|
||||
/*!
|
||||
@@ -27,18 +28,6 @@ synergy. Each architecture must implement this interface.
|
||||
*/
|
||||
class IArchLog : public IInterface {
|
||||
public:
|
||||
//! Log levels
|
||||
/*!
|
||||
The logging priority levels in order of highest to lowest priority.
|
||||
*/
|
||||
enum ELevel {
|
||||
kERROR, //!< For serious or fatal errors
|
||||
kWARNING, //!< For minor errors and warnings
|
||||
kNOTE, //!< For messages about notable events
|
||||
kINFO, //!< For informational messages
|
||||
kDEBUG //!< For debugging messages
|
||||
};
|
||||
|
||||
//! @name manipulators
|
||||
//@{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user