change Prtinfo to Note.

This commit is contained in:
Liu Ming 2016-06-08 09:00:24 +02:00
parent 3573ab0181
commit aa51ea67bc
6 changed files with 21 additions and 20 deletions

View File

@ -52,7 +52,7 @@ namespace Log {
prefix = "debug";
break;
case MessageType::Info:
case MessageType::Prtinfo:
case MessageType::Note:
prefix = "info";
break;
case MessageType::Warning:
@ -79,6 +79,7 @@ namespace Log {
switch (messageType) {
case MessageType::Debug:
case MessageType::Info:
case MessageType::Note:
return message; // No color coding, not even the code for default color.
case MessageType::Warning:
return AnsiTerminalColors::blue_strong + message + AnsiTerminalColors::none;

View File

@ -32,11 +32,11 @@ namespace Log {
const int64_t Error = 8; /* Error in the input data - should probably exit. */
const int64_t Problem = 16; /* Calculation problems - e.g. convergence failure. */
const int64_t Bug = 32; /* An inconsistent state has been encountered in the simulator - should probably exit. */
const int64_t Prtinfo = 64; /* Information that should only go into print file.*/
const int64_t Note = 64; /* Information that should only go into print file.*/
}
const int64_t DefaultMessageTypes = MessageType::Debug + MessageType::Info + MessageType::Warning + MessageType::Error + MessageType::Problem + MessageType::Bug + MessageType::Prtinfo;
const int64_t NoDebugMessageTypes = MessageType::Info + MessageType::Warning + MessageType::Error + MessageType::Problem + MessageType::Bug + MessageType::Prtinfo;
const int64_t DefaultMessageTypes = MessageType::Debug + MessageType::Info + MessageType::Warning + MessageType::Error + MessageType::Problem + MessageType::Bug + MessageType::Note;
const int64_t NoDebugMessageTypes = MessageType::Info + MessageType::Warning + MessageType::Error + MessageType::Problem + MessageType::Bug + MessageType::Note;
const int64_t StdoutMessageTypes = MessageType::Info + MessageType::Warning + MessageType::Error + MessageType::Problem + MessageType::Bug;
/// Terminal codes for ANSI/vt100 compatible terminals.

View File

@ -36,7 +36,7 @@ namespace Opm {
addMessageType( Log::MessageType::Error , "error");
addMessageType( Log::MessageType::Problem , "problem");
addMessageType( Log::MessageType::Bug , "bug");
addMessageType( Log::MessageType::Prtinfo , "prtinfo");
addMessageType( Log::MessageType::Note , "note");
}
void Logger::addTaggedMessage(int64_t messageType, const std::string& tag, const std::string& message) const {

View File

@ -81,9 +81,9 @@ namespace Opm {
}
void OpmLog::prtinfo(const std::string& message)
void OpmLog::note(const std::string& message)
{
addMessage(Log::MessageType::Prtinfo, message);
addMessage(Log::MessageType::Note, message);
}
@ -125,9 +125,9 @@ namespace Opm {
void OpmLog::prtinfo(const std::string& tag, const std::string& message)
void OpmLog::note(const std::string& tag, const std::string& message)
{
addTaggedMessage(Log::MessageType::Prtinfo, tag, message);
addTaggedMessage(Log::MessageType::Note, tag, message);
}

View File

@ -48,7 +48,7 @@ public:
static void problem(const std::string& message);
static void bug(const std::string& message);
static void debug(const std::string& message);
static void prtinfo(const std::string& message);
static void note(const std::string& message);
static void info(const std::string& tag, const std::string& message);
static void warning(const std::string& tag, const std::string& message);
@ -56,7 +56,7 @@ public:
static void problem(const std::string& tag, const std::string& message);
static void bug(const std::string& tag, const std::string& message);
static void debug(const std::string& tag, const std::string& message);
static void prtinfo(const std::string& tag, const std::string& message);
static void note(const std::string& tag, const std::string& message);
static bool hasBackend( const std::string& backendName );
static void addBackend(const std::string& name , std::shared_ptr<LogBackend> backend);

View File

@ -169,12 +169,12 @@ BOOST_AUTO_TEST_CASE( CounterLogTesting) {
counter.addMessage( Log::MessageType::Error , "This is an error ...");
counter.addMessage( Log::MessageType::Warning , "This is a warning");
counter.addMessage( Log::MessageType::Prtinfo , "This is a info(prtinfo)");
counter.addMessage( Log::MessageType::Note , "This is a info(note)");
BOOST_CHECK_EQUAL(1U , counter.numMessages( Log::MessageType::Error ));
BOOST_CHECK_EQUAL(1U , counter.numMessages( Log::MessageType::Warning ));
BOOST_CHECK_EQUAL(0 , counter.numMessages( Log::MessageType::Info ));
BOOST_CHECK_EQUAL(1U , counter.numMessages( Log::MessageType::Prtinfo ));
BOOST_CHECK_EQUAL(1U , counter.numMessages( Log::MessageType::Note ));
{
int64_t not_enabled = 4096;
@ -254,7 +254,7 @@ BOOST_AUTO_TEST_CASE(TestHelperFunctions)
// prefixMessage
BOOST_CHECK_EQUAL(prefixMessage(MessageType::Error, "message"), "error: message");
BOOST_CHECK_EQUAL(prefixMessage(MessageType::Info, "message"), "info: message");
BOOST_CHECK_EQUAL(prefixMessage(MessageType::Prtinfo, "message"), "info: message");
BOOST_CHECK_EQUAL(prefixMessage(MessageType::Note, "message"), "info: message");
// colorCode Message
BOOST_CHECK_EQUAL(colorCodeMessage(MessageType::Info, "message"), "message");