From d9a38657d3f97a2543ea1528732cc6abe5e525c9 Mon Sep 17 00:00:00 2001 From: dufourj Date: Tue, 14 Mar 2006 01:47:30 +0000 Subject: Log : - Découpage en différents types de logger ; - Création d'un logger null utilisé pour les messages non traités ; - Création d'un logger stdout pour la sortie sur stdout. TODO : - Créer un logger pour fichier ; - Créer un logger en ram. --- i/marvin/src/log/logger_null.hh | 51 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 i/marvin/src/log/logger_null.hh (limited to 'i/marvin/src/log/logger_null.hh') diff --git a/i/marvin/src/log/logger_null.hh b/i/marvin/src/log/logger_null.hh new file mode 100644 index 0000000..03c71a6 --- /dev/null +++ b/i/marvin/src/log/logger_null.hh @@ -0,0 +1,51 @@ +#ifndef logger_null_hh +#define logger_null_hh +// logger_null.hh +// marvin - programme du robot 2006. {{{ +// +// Copyright (C) 2006 Dufour Jérémy +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Contact : +// Web: %WEB% +// Email: +// }}} + +#include "logger.hh" + +/// Null logger to prevent losing time. +class LoggerNull : public Logger +{ + public: + /// Default empty constructor. + LoggerNull (void) { } + /// Default empty destructor. + ~LoggerNull (void) { } + /// Empty start. + void start (const Log &, const char *, Log::Level) { } + /// Empty stop. + void stop (void) { } + /// Empty << string or variable name. + LoggerNull &operator<< (const char *) { return *this; } + /// Empty << string or variable name. + LoggerNull &operator<< (const std::string &) { return *this; } + /// Empty << integer. + LoggerNull &operator<< (int) { return *this; } + /// Empty << double. + LoggerNull &operator << (double) { return *this; } +}; + +#endif // logger_null_hh -- cgit v1.2.3