summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/log/log.cc
diff options
context:
space:
mode:
authorschodet2005-03-06 14:13:45 +0000
committerschodet2005-03-06 14:13:45 +0000
commit9765c8a6b33f01ca6386b87b903381536def331f (patch)
treeb9fd25ca50e4cb0671996506a0d4c49021f850ee /2005/i/robert/src/log/log.cc
parent55cece3881dac725b8e79f3a9a3a8af02a2b2054 (diff)
Changement de toLevelMask
Correction de l'operator<< générique.
Diffstat (limited to '2005/i/robert/src/log/log.cc')
-rw-r--r--2005/i/robert/src/log/log.cc24
1 files changed, 3 insertions, 21 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);
}