summaryrefslogtreecommitdiff
path: root/2005/i
diff options
context:
space:
mode:
authorschodet2005-03-06 14:13:45 +0000
committerschodet2005-03-06 14:13:45 +0000
commit9765c8a6b33f01ca6386b87b903381536def331f (patch)
treeb9fd25ca50e4cb0671996506a0d4c49021f850ee /2005/i
parent55cece3881dac725b8e79f3a9a3a8af02a2b2054 (diff)
Changement de toLevelMask
Correction de l'operator<< générique.
Diffstat (limited to '2005/i')
-rw-r--r--2005/i/robert/src/log/log.cc24
-rw-r--r--2005/i/robert/src/log/log.hh4
-rw-r--r--2005/i/robert/src/log/log_message.tcc2
3 files changed, 6 insertions, 24 deletions
diff --git a/2005/i/robert/src/log/log.cc b/2005/i/robert/src/log/log.cc
index e0607ef..1818b99 100644
--- a/2005/i/robert/src/log/log.cc
+++ b/2005/i/robert/src/log/log.cc
@@ -93,28 +93,10 @@ Log::toLevel (const std::string &level)
}
}
-/// Traduit le masque de niveau de log.
+/// Change un niveau de log en masque.
Log::Level
-Log::toLevelMask (const std::string &level)
+Log::toLevelMask (Log::Level level)
{
- switch (level[0])
- {
- case 'n':
- return static_cast<Level> (none);
- case 'f':
- return static_cast<Level> (fatal);
- case 'e':
- return static_cast<Level> (error | fatal);
- case 'w':
- return static_cast<Level> (warning | error | fatal);
- case 'i':
- return static_cast<Level> (info | warning | error | fatal);
- case 'd':
- return static_cast<Level> (debug | info | warning | error | fatal);
- case 'v':
- return static_cast<Level> (verydebug | debug | info | warning | error | fatal);
- default:
- return toLevel (level);
- }
+ return static_cast <Level> ((level - 1) | level);
}
diff --git a/2005/i/robert/src/log/log.hh b/2005/i/robert/src/log/log.hh
index 055f00e..387a2c4 100644
--- a/2005/i/robert/src/log/log.hh
+++ b/2005/i/robert/src/log/log.hh
@@ -61,8 +61,8 @@ class Log
static std::string toString (Level level);
/// Traduit le niveau de log.
static Level toLevel (const std::string &level);
- /// Traduit le masque de niveau de log.
- static Level toLevelMask (const std::string &level);
+ /// Change un niveau de log en masque.
+ static Level toLevelMask (Level level);
};
#include "log_message.hh"
diff --git a/2005/i/robert/src/log/log_message.tcc b/2005/i/robert/src/log/log_message.tcc
index ecf4970..98ac01b 100644
--- a/2005/i/robert/src/log/log_message.tcc
+++ b/2005/i/robert/src/log/log_message.tcc
@@ -30,7 +30,7 @@ template<typename OutputStreamable>
LogMessage &
LogMessage::operator<< (const OutputStreamable &o)
{
- std::cout << o;
+ std::cout << ' ' << o;
return *this;
}