From 9765c8a6b33f01ca6386b87b903381536def331f Mon Sep 17 00:00:00 2001 From: schodet Date: Sun, 6 Mar 2005 14:13:45 +0000 Subject: Changement de toLevelMask Correction de l'operator<< générique. --- 2005/i/robert/src/log/log.cc | 24 +++--------------------- 2005/i/robert/src/log/log.hh | 4 ++-- 2005/i/robert/src/log/log_message.tcc | 2 +- 3 files changed, 6 insertions(+), 24 deletions(-) (limited to '2005/i/robert') 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 (none); - case 'f': - return static_cast (fatal); - case 'e': - return static_cast (error | fatal); - case 'w': - return static_cast (warning | error | fatal); - case 'i': - return static_cast (info | warning | error | fatal); - case 'd': - return static_cast (debug | info | warning | error | fatal); - case 'v': - return static_cast (verydebug | debug | info | warning | error | fatal); - default: - return toLevel (level); - } + return static_cast ((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 LogMessage & LogMessage::operator<< (const OutputStreamable &o) { - std::cout << o; + std::cout << ' ' << o; return *this; } -- cgit v1.2.3