From 8cfe3413142a349802cc7daf7261a1bfa1cd1f5e Mon Sep 17 00:00:00 2001 From: schodet Date: Wed, 9 Feb 2005 14:04:00 +0000 Subject: Fix: oublie d'affichage du message. --- 2005/i/robert/src/log/log.cc | 20 ++++++++++---------- 2005/i/robert/src/log/log.hh | 2 +- 2005/i/robert/src/log/log_message.cc | 1 + 3 files changed, 12 insertions(+), 11 deletions(-) (limited to '2005') diff --git a/2005/i/robert/src/log/log.cc b/2005/i/robert/src/log/log.cc index 7f65efa..e0607ef 100644 --- a/2005/i/robert/src/log/log.cc +++ b/2005/i/robert/src/log/log.cc @@ -44,27 +44,27 @@ Log::operator() (const char *msg, Level level/*info*/) const } /// Traduit le niveau de log. -void -Log::toString (Level level, std::string &s) +std::string +Log::toString (Level level) { switch (level) { case none: - s = "none"; break; + return "none"; case fatal: - s = "fatal"; break; + return "fatal"; case error: - s = "error"; break; + return "error"; case warning: - s = "warning"; break; + return "warning"; case info: - s = "info"; break; + return "info"; case debug: - s = "debug"; break; + return "debug"; case verydebug: - s = "verydebug"; break; + return "verydebug"; default: - s = "logunknown"; break; + return "logunknown"; } } diff --git a/2005/i/robert/src/log/log.hh b/2005/i/robert/src/log/log.hh index 026b1f0..055f00e 100644 --- a/2005/i/robert/src/log/log.hh +++ b/2005/i/robert/src/log/log.hh @@ -58,7 +58,7 @@ class Log /// Récupère l'instance. const char *getInstance (void) const { return instance_; } /// Traduit le niveau de log. - static void toString (Level level, std::string &s); + 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. diff --git a/2005/i/robert/src/log/log_message.cc b/2005/i/robert/src/log/log_message.cc index 68568c1..4a3af9a 100644 --- a/2005/i/robert/src/log/log_message.cc +++ b/2005/i/robert/src/log/log_message.cc @@ -32,6 +32,7 @@ LogMessage::LogMessage (const Log &log, const char *msg, Log::Level level) std::cout << log.getModule () << ':'; if (log.getInstance ()) std::cout << ' ' << log.getInstance () << ':'; + std::cout << ' ' << msg; } /// Destructeur. -- cgit v1.2.3