merged 1.4 r982:983 into trunk

This commit is contained in:
Nick Bolton
2011-05-09 00:28:45 +00:00
parent 627771cf13
commit 13c6c36107
18 changed files with 208 additions and 86 deletions

View File

@@ -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

View File

@@ -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,

View File

@@ -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();
}

View File

@@ -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*);
};

View File

@@ -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;
//@}
};

View File

@@ -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
//@{